I need to find all instances, references, etc, of a layer and change it to another layer. I'm not talking about lines and objects or even blocks, but more like properties nested inside of wall styles and cleanup definitions, anything like that. I can't use the QSELECT or any similar command because the layer in question is being referenced inside of individual styles (i'm guessing that's the only place).
Does anyone have a lisp routine written for such a problem? or know how to write one to tackle it?
If you are interested to find out exactly how I got to have this problem, I will explain below.
We drew our interior walls and our exterior shell for our building on two different drawings so that two people could work on them at the same time. They were xref'd into each other. We got to a point where we needed to put them back into one drawing so I binded the Shell Xref into the interior drawing. This saved us a lot of time but now all the layers from the Shell drawing have this prefix to it "01Shell&0&". This isn't really a problem but I'm a bit OCD and it bothers me to have two different layers for the same thing, one regular and one with the prefix. It means everytime we change the properties of a layer, we have to do it twice. I've already changed everything I could back to the original layers but the Shell layers still show up from time to time. They are nested deep inside of wall styles and custom cleanup properties, custom encaps, and so on.
I found a similar post which might shed some light on anyone willing to do some scripting:
Thanks for looking and for any help you might provide.
Solved! Go to Solution.
If the prefix of the layers of the bound xref bother you use the "insert" method when binding a xref.
This will insert that xref as block.
Explode the block and all layers that have the same name as the host drawing will merge.
Other layers will be added without the prefix.
You can probably resolve your problem with a lisp.
Or manually rename and delete the prefix
Thanks for the reply.
I wish I knew that I should have inserted and not bound the xref into the drawing. I will do that from now on.
I haven't found any ways to resolve the problem without a lisp besides going into all the different styles other definitions manually one by one and changing the layer there.
I cannot change the name to the name that I want that layer to be because that layer already exists.
I've always used this method to bind xrefs, like you I don't like the prefix is adds to the layers.
Have you tried to merge the layers ?
Use LAYMRG on the command line.
You can select layers, or multiple layers to merge with another layer by selection.
Thanks for that, that totally worked.
I had tried it before but typed in the command incorrectly. I thought for some reason that command was discontinued in the newer AutoCAD or something. Good stuff, now I feel like an idiot
Have you tried the laymrg command. It does what you want, although I've never tried it for layers referenced inside styles. But since it's no longer an express tool, one would hope that it would be robust enough. (looks like Leo beat me to it)
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.