Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selecting a Layer by Using Only a Potion of its Full Name / Label

21 REPLIES 21
Reply
Message 1 of 22
noeltek
1396 Views, 21 Replies

Selecting a Layer by Using Only a Potion of its Full Name / Label

Ultimately I want to delete a bunch of Layers by selecting them using a portion of their name. Is there anything in cad that allows you to specifically select layers using only a portion of the layer name???

 

Based on AutoCAD Layer Standards: Users label layers with a code; for example: A-ANNO-TEXT

 

A - Stands for the Architectural Category the layer falls into

ANNO - Stands for Annotation

TEXT - Type of Annotation

 

I want to use the Layer Delete (-LAYDEL) command to delete all layers that begin with A-ANNO. In the Layer Manager (-LAYER) I am able to select specific layers using a " * " placed before and/or after " A-ANNO " to include all layers with that in its name.

 

When I write a script however (-LAYDEL); cad will ask me for the layer name, but will not allow me to use the *A-ANNO* to include all layers with that name: A-ANNO-TEXT, A-ANNO-GLAZ, A-ANNO-WALL, etc...

 

Is there anything in cad that allows you to specifically select layers using only a portion of the layer name??? This would help me tremendously because I have to "taylor" drawings that I receive from companies who's layers may vary.

 

My script is in basic (NON LISP) language:

 

-LAYDEL
N
A-GENM
N
A-DOOR
N
A-DOOR-FRAM
N
A-DOOR-GLAZ
N

 

Y

 

I do not care what script you may use to help me out.. I'd welcome any suggestion to solve this issue.

21 REPLIES 21
Message 21 of 22
alanjt_
in reply to: BlackBox_

Also, keep in mind that, with civil 3d and other style driven platforms, even if all objects have been deleted, but the layer is referenced by a style, deleting the layer definition with vla-delete will throw still throw an error. -laydel is the only thing that will ignore the style link and blow it out regardless. 

 

Oh yeah, and it's been too long since I've used this...

 

Message 22 of 22
noeltek
in reply to: noeltek

Everyone,

 

I wanted to let you know this new LISP program has been a great help and eliminated many working hours saving my company money. We have placed it as a button on our own custimized toolbar and will be looking into other improvments as we move into the future. I appriciate everyones involvment and just want you to know that it has helped more people than you know.

 

Thank you!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost