psluca91
Guest
Good afternoon to all,
I apologize in advance if the subject has already been dealt with in other topics and for the banality of the matter, but I have not been able to find a guide or discussions that help me through the search function.
I wrote the following lisp by taking code from other lisp found on the net:
the lisp works but I have to select the blocks one by one. How can I do to perform the lisp on multiple blocks at once?
thanks in advance!
I apologize in advance if the subject has already been dealt with in other topics and for the banality of the matter, but I have not been able to find a guide or discussions that help me through the search function.
I wrote the following lisp by taking code from other lisp found on the net:
Code:
;;change color by layer in the respective color and layer "0"
(defun c:ccb (/ b_name col)
(setq b_name (cdr (assoc 2 (entget (car)))))))
(command "-bedit" b_name)
(setq listobj (ssget "x"))
(setq nobj (sslength listobj)
(setq control 0)
(while (< nobj control)
(setq obj (entget (ssname listobj control) ))
(setq color (assoc '62 obj))
(if (= color nil)
(progn)
(setq objlay (assoc '8 obj))
(setq laycol (cdr (assoc '62 (tblsearch "layer"))))
(command "_change" (cdar obj) "_prop" "_color" laycol ")
);
);
(setq control (+ control 1))
) ; while control closure
(command "_chprop" "_all" "_layer" 0 "_bclose"")
); defunct closure
thanks in advance!