HELP Looping convert Bylayer colour and linetype

Discussion of Common Lisp

HELP Looping convert Bylayer colour and linetype

Postby Micko79 » 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.

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

)
Last edited by nuntius on Wed Nov 02, 2011 5:05 am, edited 1 time in total.
Reason: fixed code block
Micko79
 
Posts: 3
Joined: Tue Nov 01, 2011 11:25 pm

Re: HELP Looping convert Bylayer colour and linetype

Postby Paul » Wed Nov 02, 2011 5:40 pm

I suspect you want to post in the "Other dialects" subgroup.
Paul
 
Posts: 106
Joined: Tue Jun 02, 2009 6:00 am

Re: HELP Looping convert Bylayer colour and linetype

Postby Micko79 » Thu Nov 03, 2011 5:19 am

Cheers Paul. I have reposted there too. hopefully someone can help.
Micko79
 
Posts: 3
Joined: Tue Nov 01, 2011 11:25 pm


Return to Common Lisp

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron