Jump to content
Rubbersnow

Replacing Layers with other ones

Recommended Posts

Rubbersnow

Hey Guys, I have the following problem.

I'm working on HVAC project and after I have almost finished the whole project the managers company sent me new template layers file ,that I should follow. So now my "17_COOL_MEPA_SUP" layer and all of his futures (including color,line thicknes and so on) need to be changed to "10_C_HVAC_S" with other futures (different color,different thicknes). I know that I can rename group of layers by using script file ,but can I totally replace group of layers with another group?

 

P.S. I have 130 drawings ,so the manual method is not an option.

 

HEEEEELLLLPPPPP!!!! :shock:

Share this post


Link to post
Share on other sites
steven-g

Do you mean replacing many layers with one ? That would be layermerge

Share this post


Link to post
Share on other sites
Rubbersnow

no. I mean for example 30 layers to be replaced with 30 other layers

Share this post


Link to post
Share on other sites
steven-g

Then I think your only option is a script or LISP, there is no built in command for bulk rename, unless you could use *wildcard* changes for common parts of a name.

Share this post


Link to post
Share on other sites
Rubbersnow

I was thinking for script ,but I have no idea how to write it. Pretty complicated for my AutoCad level :(

Share this post


Link to post
Share on other sites
steven-g

Do you have use of Excel ?

Share this post


Link to post
Share on other sites
Rubbersnow

what do you mean?

Share this post


Link to post
Share on other sites
ReMark

AutoCAD 2011. Does that version have the Layer Translator command?

 

In the Layer Translator, you specify the layers in the current drawing that you want to translate, and the layers to translate them to. The translation maps the layers in the current drawing to different layer names and layer properties in a specified drawing or standards file, and then converts them using those mappings.

Share this post


Link to post
Share on other sites
steven-g
what do you mean?

If you have microsoft Excel it's pretty easy to make a script with that, if you have Excel I can post an example

 

EDIT: Just spotted ReMarks answer, that may be easier

Share this post


Link to post
Share on other sites
Rubbersnow

yes, I just tried it. "-LAYTRANS" . Is it working for my purpose

AutoCAD 2011. Does that version have the Layer Translator command?

 

In the Layer Translator, you specify the layers in the current drawing that you want to translate, and the layers to translate them to. The translation maps the layers in the current drawing to different layer names and layer properties in a specified drawing or standards file, and then converts them using those mappings.

Share this post


Link to post
Share on other sites
Rubbersnow

yes I have excel. It will be great help if you send me example.

If you have microsoft Excel it's pretty easy to make a script with that, if you have Excel I can post an example

 

EDIT: Just spotted ReMarks answer, that may be easier

Share this post


Link to post
Share on other sites
steven-g

!! Not available in LT !!

EDIT thats the command laytrans not available in LT

Share this post


Link to post
Share on other sites
Rubbersnow

I'm using complete version of AutoCad 2011

 

yours is LT you mean

Share this post


Link to post
Share on other sites
steven-g

in column A the old names

in column B put the new names

and column F is the script, it just uses a simple formula to make up the script, select all the cells in column F press Ctrl+C for copy and then on the Autocad command line right click and choose paste. The example is only 8 names but shows the idea.

LayerChange.xls

Share this post


Link to post
Share on other sites
ReMark

After some searching I did find a lisp routine that in my one and only test did work. It renamed all five layers in my drawing. I suppose if you use a script and call the lisp routine it would be possible to batch process all 130 drawings.

Share this post


Link to post
Share on other sites
Rubbersnow
After some searching I did find a lisp routine that in my one and only test did work. It renamed all five layers in my drawing. I suppose if you use a script and call the lisp routine it would be possible to batch process all 130 drawings.

 

 

Yes. If I can rename automatically all of my current layers with the same names as the requested layers ,than I can use "LAYTRANS" and everything will happen in no time

 

can you show me an example of the lisp routine

Share this post


Link to post
Share on other sites
ReMark

Show it to you? I can do better than that; I can upload a copy. Hold on....I'll be back.8)

 

The lisp routine, LayerRename.lsp, has been attached below. I assume you know how to load lisp routines right?

 

I suggest you run a test first. Create a new drawing with five layers named Layer1 thru Layer5. Load the routine and run it. Verify it works.

 

LayerRename.lsp

Share this post


Link to post
Share on other sites
rkent

AutoCAD had the Standards command built-in and was made for this very scenario.

Share this post


Link to post
Share on other sites
Rubbersnow

thank you very much ReMark ,it is working perfect. :D I've just made the dance of happiness and now half of the office thinks that I'm high or something :P

 

You are saving me hours of work. 10x :notworthy: :notworthy: :notworthy:

Share this post


Link to post
Share on other sites
ReMark

You're entirely welcomed Rubbersnow. I'm glad to hear the lisp routine has helped to solve your problem. You might give some thought to rkent's suggestion re: the Standards command. It could come in handy for addressing problems not addressed by the lisp routine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×