Hi
I've got a lisp to isolate layers and dropped it into my usual startup lisp. The trouble is that if I cancel the command I get the error message below. It is all on the command line and not a real problem as I can just escape out. Just wondering if I can put something in or need to take something out to avoid the annoying message.
Many thanks
Martin
_____________________
Command: il
Reading Layer Definitions
Pick an Object on Layer(s) to Isolate : *Cancel*
Function cancelled
Cannot find UCS "resetucs".
; error: An error has occurred inside the *error* functionFunction cancelled
Enter name of UCS to restore or [?]: *Cancel*
___________________________________________
;;;ISOLATE LAYER.LSP
(defun reclay ()
(prompt "\nReading Layer Definitions")
(setq LAYLST nil
LAYOFF nil
LAYNAM (cdr (assoc 2 (tblnext "LAYER" 1)))
);setq
(while LAYNAM
(if (< (cdr (assoc 62 (tblsearch "LAYER" LAYNAM))) 0)
(progn
(setq LAYOFF (cons LAYNAM LAYOFF))
(prompt ".")
);progn
);if
(setq LAYLST (cons LAYNAM LAYLST)
LAYNAM (cdr (assoc 2 (tblnext "LAYER")))
);setq
);while
(if LAYOFF
(setq LAYOFF (acad_strlsort LAYOFF))
);if
);defun
(defun C:IL ( / expert )
(setq isol_lst nil
expert (getvar "expert")
);setq
(setvar "cmdecho" 0)
(setvar "expert" 4)
(reclay)
(while (setq isol_ent (nentsel "\nPick an Object on Layer(s) to Isolate : "))
(setq isol_lay (cdr (assoc 8 (entget (car isol_ent))))
isol_lst (cons isol_lay isol_lst)
);setq
(prompt (strcat "" isol_lay ""))
);while
(if isol_lst
(progn
(command ".layer" "off" "*")
(foreach lay isol_lst
(command "on" lay)
);foreach
(command "")
);progn
);if
(setvar "expert" expert)
(princ)
);defun