I have an error trapping question. The below lisp works fine in that it creates a layer with specified colors and thickness, lets you draw then when your done it puts you back to the "0" layer.
The problem is if you hit cancel during the command, it kicks you out and leaves you on the new layer.
The question is, can I get this routine to default back to the "0" layer if someone hits cancel during the command?
Any help would be appreciated.
Code:
(defun c:1 ()
(command "_-layer" "new" "_EFA-WIRE-FIRE"
"Lweight" ".4" "_EFA-WIRE-FIRE"
"color" "red" "_EFA-WIRE-FIRE"
"")
(command "_-layer"
"set"
"_EFA-WIRE-FIRE"
"")
(command "line")
(setq lp 1)
(while lp
(if (> (getvar "cmdactive") 0) (command pause) (progn (setq lp nil) (command "")))
);end lp
(command "layer" "set" "0" "")
(princ)
)