AutoCAD Architecture General Discussion

AutoCAD Architecture General Discussion

Reply
Active Contributor
xEndlessxUrbiax
Posts: 33
Registered: ‎10-07-2011
Message 1 of 6 (256 Views)
Accepted Solution

Replace all references of Layer to other Layer

256 Views, 5 Replies
09-26-2012 09:34 AM

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.

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.

*Expert Elite*
leothebuilder
Posts: 481
Registered: ‎07-05-2010
Message 2 of 6 (253 Views)

Re: Replace all references of Layer to other Layer

09-26-2012 10:56 AM in reply to: xEndlessxUrbiax

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

Active Contributor
xEndlessxUrbiax
Posts: 33
Registered: ‎10-07-2011
Message 3 of 6 (248 Views)

Re: Replace all references of Layer to other Layer

09-26-2012 11:19 AM in reply to: leothebuilder

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. 

*Expert Elite*
leothebuilder
Posts: 481
Registered: ‎07-05-2010
Message 4 of 6 (244 Views)

Re: Replace all references of Layer to other Layer

09-26-2012 11:33 AM in reply to: xEndlessxUrbiax

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.

Active Contributor
xEndlessxUrbiax
Posts: 33
Registered: ‎10-07-2011
Message 5 of 6 (237 Views)

Re: Replace all references of Layer to other Layer

09-26-2012 11:38 AM in reply to: leothebuilder

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 :smileytongue:

Distinguished Contributor
John.W.Mumaw
Posts: 129
Registered: ‎03-17-2007
Message 6 of 6 (236 Views)

Re: Replace all references of Layer to other Layer

09-26-2012 11:39 AM in reply to: xEndlessxUrbiax

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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.