AUTOLISP Extract Layer Name from each record in the Layer Table

AUTOLISP Extract Layer Name from each record in the Layer Table

charlesc32
Contributor Contributor
297 Views
2 Replies
Message 1 of 3

AUTOLISP Extract Layer Name from each record in the Layer Table

charlesc32
Contributor
Contributor

Hello

 

I've been searching feverishly, and I can't find a posting of How to extract a single record from the Layer Table and separate the Layer name for comparison and execution before moving on to the following record and thus next layer name until list is exhausted. I need to merge a list of layers from roughly 200 down to 40. Any help would be appreciated.

Thanks

0 Likes
Accepted solutions (2)
298 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant
Accepted solution

Try this:

 

(while (setq lay (tblnext "layer" (not lay)))

  (setq lname (cdr (assoc 2 lay)))

  ( ... do whatever based on the name ... )

); while

Kent Cooper, AIA
Message 3 of 3

charlesc32
Contributor
Contributor
Accepted solution

Your suggestion worked nicely. I'm able to extract the Layer Name and manipulate as needed.

 

Thanks for the Help

0 Likes