Page 1 of 1

HELP Looping convert Bylayer colour and linetype

Posted: Tue Nov 01, 2011 11:30 pm
by Micko79
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.

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" "") 

)

Re: HELP Looping convert Bylayer colour and linetype

Posted: Wed Nov 02, 2011 5:40 pm
by Paul
I suspect you want to post in the "Other dialects" subgroup.

Re: HELP Looping convert Bylayer colour and linetype

Posted: Thu Nov 03, 2011 5:19 am
by Micko79
Cheers Paul. I have reposted there too. hopefully someone can help.