AutoCAD Architecture Forum
Welcome to Autodesk’s AutoCAD Architecture Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Replace all references of Layer to other Layer

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
xEndlessxUrbiax
2584 Views, 5 Replies

Replace all references of Layer to other Layer

The problem:

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:

http://forums.autodesk.com/t5/AutoCAD-Land-Desktop/Find-Objects-on-Layer-so-I-can-Delete-the-Layer/t...

 

Thanks for looking and for any help you might provide.

5 REPLIES 5
Message 2 of 6

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

Message 3 of 6

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. 

Message 4 of 6

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.

Message 5 of 6

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 😛

Message 6 of 6

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)

 

John

John W. Mumaw
Timber Frame Designer
Lost Bent Woodworking & Design

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

Post to forums  

Autodesk Design & Make Report

”Boost