Hi,
How can i change the insertion layer of All blocks in the drawing to its original layer of Creation
by modifying this lisp which convert block creation layer to layer "0"
e.g
As attached
the "tree" Block lie on layer "0" , i need to change its layer to layer "tree"
the "Wmh" Block lie on layer "TREE" , i need to change its layer to layer "water Manhole"
Thanks
;;;;Lisp to Change Block Layer To Layer 0
(defun c:CBLay ( / e i l n s x )
(if (setq s (ssget '((0 . "INSERT"))))
(repeat (setq i (sslength s))
(if (not (member (setq n (cdr (assoc 2 (entget (ssname s (setq i (1- i))))))) l))
(progn
(setq e (tblobjname "block" n)
l (cons n l)
)
(while (setq e (entnext e))
(setq x (entget e))
(entmod (subst '(8 . "0") (assoc 8 x) x))
)
)
)
)
)
(command "_.regen")
(princ)
)