AutoLISP to create unique layer (FOR EACH) object in Selection Set

AutoLISP to create unique layer (FOR EACH) object in Selection Set

rcavanaugh
Explorer Explorer
286 Views
2 Replies
Message 1 of 3

AutoLISP to create unique layer (FOR EACH) object in Selection Set

rcavanaugh
Explorer
Explorer

This may be a long shot, but here goes. 

Requesting assistance with a LISP which places all selected objects on NEW and UNIQUE layers.  For example, 20+ or more Plines, Lines, circles, etc are all on layer "0", seeking to create a new layer for each selected object, with each object then placed on its own unique layer. 

 

The total layers created would be equal to the number of objects initially created, therefore it may be necessary to limit the total objects in the Selection Set.

 

Layer names are not important as they will be eventually updated and could simply be (Layer01, Layer02, Layer03) [sequential  names would be best].  Colors, Linetypes, Transparency, etc can all be default.

I can easily move selected objects to a single layer, but needing each object selected to be placed on a unique layer such that each can be individually evaluated.

 

The necessity is due to receiving CAD files where ALL objects are placed on a single layer ("O "for example)  

Any help would be appreciated!

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

ВeekeeCZ
Consultant
Consultant
Accepted solution

That won't be difficult... but don't you want rather distribute objects to layers based on unique set of properties? 

0 Likes
Message 3 of 3

rcavanaugh
Explorer
Explorer

BeeKeeCZ, thank you for sharing!  For my purposes, this works great!

I still may need to create layers without the "object distribution" option. 

 

Would you recommend an excerpt from your LISP routine to accomplish this, or maybe it's better to manipulate the options within "setbylayer" dialog to accomplish this simpler task?

Thank you again, this is something I've had on my wish list for years!

0 Likes