Hey gang,
I have the following code in a tool palette icon:
Code:
^C^C(if ASPHALTTOPCOURSE (ASPHALTTOPCOURSE) (princ "Asphalt Top Course not loaded."))
This issues a command defined in acaddoc.lsp that creates a hatch:
Code:
;Asphalt Top Course
(defun ASPHALTTOPCOURSE ( / TMP CAS NHS)
(setvar "NOMUTT" 1)
(setvar "CMDECHO" 0)
(setq TMP (getvar 'clayer))
(setq CAS (getvar 'cannoscalevalue))
(setq NHS (/ 0.3333333333333333 CAS))
(command
"_.-layer" "_m" "L-HTCH-SCRN-MEDM" "_c" "8" "L-HTCH-SCRN-MEDM" ""
"_.-hatch" "_p" "ANSI31" NHS "45" "_a" "_a" "_y" ""
)
(while (= 1 (logand 1 (getvar 'cmdactive))) (vl-cmdf "\\"))
(setvar 'clayer tmp)
(setvar "NOMUTT" 0)
(setvar "CMDECHO" 1)
(princ)
)
It works fine except that when I click the icon, I get this at the command line:
Command: (if ASPHALTTOPCOURSE (ASPHALTTOPCOURSE) (princ "Asphalt Top Course not loaded."))
It shouldn't echo anything unless the command has not loaded and then it should simply report "Asphalt Top Course not loaded."
Any idea why it's echoing the entire command string and how I might prevent it from doing so?
Thanks in advance for your help.
-JP