"nil" echoed in AutoCad 2004

Feb 16, 2008 3 Replies

The following lisp routine executes just fine but returns the word 'nil'. Does it mean that there's something wrong somewhere?



(command "layer" "make" (strcat "rev_" (substr (rtos (getvar "cdate")



1 14) 4 12)) "" "" "" "" "")

cmdecho is off (in case that makes any difference)


Are you running that from a button? There's no (defun) etc. In a routine you'd add a (princ) to the end to silence the return value of the last command, which in your case is 'nil'...It's called 'exiting quietly'. Maybe try appending it to your code.

Thanks Michael.

Although the *.lsp file ends with a (princ), while putting the routine together I test the lines by copy/pasting them from notepad into autocad's command prompt - hence the 'nil' , I guess. Thanks for the clearing that up.

Take a penny, leave a penny.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required