kilari_venkatesh Posted February 16, 2015 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
marko_ribar Posted February 16, 2015 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
Lee Mac Posted February 16, 2015 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
Tharwat Posted February 16, 2015 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
kilari_venkatesh Posted February 21, 2015 Author 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
kilari_venkatesh Posted February 21, 2015 Author Posted February 21, 2015 Thanks for solving the problem:) Quote
kilari_venkatesh Posted February 21, 2015 Author 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
Tharwat Posted February 21, 2015 Posted February 21, 2015 Thanks for giving the advice:D You're welcome Quote
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.