Error: AutoCAD variable setting rejected: "CLAYER" nil; error: An error has
occurred inside the *error* functionAutoCAD variable setting rejected:
"CLAYER"
nil
I'm getting this error in the following lisp. Why?
(DEFUN C:dt (/ ct curlayer tsize VS)
(SETVAR "CMDECHO" 1)
(setq
ERR *ERROR*
*ERROR* LISP-ERR
CMDECHO 1)
(SETQ CURLAYER (GETVAR "CLAYER"))
(setq ct (getvar "ctab"))
(setq NewLayer (strcat "TEXT" (substr CT 1 3)))
(COMMAND "VPLAYER" "N" NEWLAYER "")
(COMMAND "VPLAYER" "T" NEWLAYER "C" "")
(COMMAND "-LAYER" "M" NewLayer "C" "130" "" "")
(SETQ VS (/ 1 (caddr (trans '(0 0 1) 2 3))))
(setq tsize (* VS 0.125))
(SETVAR "CMDECHO" 1)
(command "_dtext" "S" "SIMPLEX" "J" pause pause tsize pause pause))
(SETVAR "CLAYER" CURLAYER)
(setvar "CMDECHO" 0)
(princ)
)
(defun
LISP-ERR (MSG)
(if (/= MSG "Function cancelled")
(princ (strcat "\nError: " MSG))
) ;_ end of if
(setvar "CLAYER" CurLAYER)
(princ)
) ;_ end of defun
--
Erik D.
CAD Manager
Atkinson Industries, Inc.
620-231-6900