HELP Looping convert Bylayer colour and linetype
Posted: Tue Nov 01, 2011 11:30 pm
Hi all, I am new to Lisp and need help looping this code. I am trying to get the ByLayer properties of Colour and Linetype and then making a new layer. For example Bylarer = RED and DASHED so placing this item on "1DASHED"
Using NENTSEL I can get it to work picking one object at a time but I want it to loop to do the entire drawing at once.
Using NENTSEL I can get it to work picking one object at a time but I want it to loop to do the entire drawing at once.
Code: Select all
(defun C:QQQ ( / esl laycol )
(while (not (setq esl (nentsel)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq LayCol (cdr (cadddr (tblsearch "layer" ( cdr(assoc 8 (entget (car esl)))))) ))
(setq LayLin (Cdr (cadr (cdddr (tblsearch "layer" ( cdr(assoc 8 (entget (car esl)))))) )) )
(setq LayName (strcat (rtos LayCol) LayLin))
(COMMAND "LAYER" "m" LayName "C" laycol LayName "Ltype" LayLin LayName "")
(COMMAND "CHPROP" esl "" "LA" LayName "C" "BYLAYER" "LType" "BYLAYER" "")
)