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

Laydel & variables

1 REPLY 1
Reply
Message 1 of 2
Jolo5309
598 Views, 1 Reply

Laydel & variables

What I am trying to do is use LISP to delete several layers from AutoCAD that you cannot purge.

 

I have multiple layers like this:

1_158_PIPE_WRT, 1_158_PIPE_WRX, 1_158_PIPE_RRT, etc

 

The exact layer names are specific to the drawing and what I am doing is converting the blocks to layer 0 (or a centreline layer) and I would like to purge the old layers, but since they are inside the blocks I would like to be able to get rid of the ones that are empty. All my piping drawings have similarly named layers that need to be purged (*_PIPE_*) but I cannot figure out if there is a way to delete the names based on a variable.

1 REPLY 1
Message 2 of 2
Kent1Cooper
in reply to: Jolo5309


@Jolo5309 wrote:

What I am trying to do is use LISP to delete several layers from AutoCAD that you cannot purge.

.... what I am doing is converting the blocks to layer 0 (or a centreline layer) and I would like to purge the old layers, but since they are inside the blocks I would like to be able to get rid of the ones that are empty. .... I cannot figure out if there is a way to delete the names based on a variable.


Laydel doesn't seem to accept wildcards in typed-in Layer names, but even if you make a list of Layer names containing your substring [which would be easy enough to do] and feed them each to Laydel somehow, be aware that unlike Purge, Laydel does not require a Layer to be empty to get rid of it.  It will remove all entities on that Layer as it removes the Layer.  It doesn't sound like that's what you want.  If I'm understanding you correctly, you might want to use LayMRG instead of LayDEL, because it will move everything on the Layer you want to get rid of to the Layer of your choice, then get rid of the old Layer.  But you may need to make a list of Layer names and feed them to it one at a time -- it doesn't like wildcards, either.

Kent Cooper, AIA

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

Post to forums  

Autodesk Design & Make Report

”Boost