I have a DEMO lisp that will take objects you select and create a new layer of the same name but with a DEMO extension at the end, and place the selected object on the new DEMO layers. I would like to add another function making the new demo layer NO PLOT as well. Below is the Lisp code I am currently using:
Code:
(defun c:demo ( / i l n s x )
(if (setq s (ssget "_:L" '((8 . "~*-DEMO"))))
(repeat (setq i (sslength s))
(setq x (vlax-ename->vla-object (ssname s (setq i (1- i))))
l (vla-get-layer x)
n (strcat l "-DEMO")
)
(if (checkmakelayer l n) (vla-put-layer x n))
)
)
(princ)
)
(defun checkmakelayer ( a b )
(cond
( (tblsearch "layer" b))
( (setq a (tblobjname "layer" a))
(setq a (entget a))
(entmake
(subst (cons 2 b) (assoc 2 a)
(subst '(62 . 204) (assoc 62 a)
(vl-remove-if '(lambda ( x ) (or (= 'ename (type (cdr x))) (= 102 (car x)))) a)
)
)
)
)
)
)
(vl-load-com) (princ)