kilari_venkatesh Posted February 16, 2015 Share Posted February 16, 2015 (edited) The program is to insert a block everything works fine but after running in the command prompt it gives " ; error: no function definition: nil " (DTR) is a function which stores the information in the list format which is provided by the user interface DCL (defun c:getDialogInput (/ input aone ) (setq input (DTR)) (setq aone (getpoint "\nSelect pickint to insert sheet: ")) (cond ((equal input '("frptitle" "LIGHT")) progn( (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP" aone "" "" 0 ) ) ) ((equal input '("fabtitle" "LIGHT"))progn( (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FAB" aone "" "" 0 ) )) ((equal input '("quotitle" "LIGHT"))progn( (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_QUO" aone "" "" 0) )) ( T (princ "Nothing") ) ) ) Edited February 23, 2015 by SLW210 Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted February 16, 2015 Share Posted February 16, 2015 (defun c:getDialogInput ( / input aone ) (setq input (DTR)) (setq aone (getpoint "\nSelect pickint to insert sheet: ")) (cond ( (equal input '("frptitle" "LIGHT")) (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP" aone "" "" 0) ) ( (equal input '("fabtitle" "LIGHT")) (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FAB" aone "" "" 0) ) ( (equal input '("quotitle" "LIGHT")) (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_QUO" aone "" "" 0) ) (T (princ "Nothing") ) ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 16, 2015 Share Posted February 16, 2015 The issue is with these expressions: progn( (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP" aone "" "" 0 ) ) Since the command function always returns nil, the interpreter will subsequently attempt to evaluate the expression: (nil) Resulting in the error 'no function definition: nil'. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 16, 2015 Share Posted February 16, 2015 Here is a way to rewrite the function cause I was bored (defun c:getDialogInput (/ input aone f) (if (and (setq input (DTR)) (setq f (assoc (car input) '(("frptitle" "LIGHT" "FRP") ("fabtitle" "LIGHT" "FAB") ("quotitle" "LIGHT" "QUO")))) (setq aone (getpoint "\nSelect pickint to insert sheet: "))) (command "-insert" (strcat "//Mailserver/d/backup/TIT_BLOCK_" (caddr f)) aone "" "" 0) (princ "Nothing") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
kilari_venkatesh Posted February 21, 2015 Author Share Posted February 21, 2015 (defun c:getDialogInput ( / input aone ) (setq input (DTR)) (setq aone (getpoint "\nSelect pickint to insert sheet: ")) (cond ( (equal input '("frptitle" "LIGHT")) (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FRP" aone "" "" 0) ) ( (equal input '("fabtitle" "LIGHT")) (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_FAB" aone "" "" 0) ) ( (equal input '("quotitle" "LIGHT")) (command "-insert" "//Mailserver/d/backup/TIT_BLOCK_QUO" aone "" "" 0) ) (T (princ "Nothing") ) ) ) Thanks for clarifying my doubt.. Quote Link to comment Share on other sites More sharing options...
kilari_venkatesh Posted February 21, 2015 Author Share Posted February 21, 2015 Thanks for solving the problem:) Quote Link to comment Share on other sites More sharing options...
kilari_venkatesh Posted February 21, 2015 Author Share Posted February 21, 2015 Here is a way to rewrite the function cause I was bored (defun c:getDialogInput (/ input aone f) (if (and (setq input (DTR)) (setq f (assoc (car input) '(("frptitle" "LIGHT" "FRP") ("fabtitle" "LIGHT" "FAB") ("quotitle" "LIGHT" "QUO")))) (setq aone (getpoint "\nSelect pickint to insert sheet: "))) (command "-insert" (strcat "//Mailserver/d/backup/TIT_BLOCK_" (caddr f)) aone "" "" 0) (princ "Nothing") ) (princ) ) Thanks for giving the advice:D Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 21, 2015 Share Posted February 21, 2015 Thanks for giving the advice:D You're welcome Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.