Wednesday, August 23, 2006

The Layer Translator

Change AutoCAD drawing layers from one standard to another using the Layer Translator. This former Express Tool has been added to the standard AutoCAD toolset.

Pull down menu: Tools > CAD Standards > Layer Translator...

The Layer Translator dialog lists the Layers of the current drawing in the Left pane. The right pane lists the target Layers. You populate the right pane by loading Layers from an existing drawing, template, or drawing standards file. You can also add new Layers on the fly using the "New..." button.

In the left pane select a Layer to translate, in the right pane select a Layer to translate to, and click the "Map" button; a Layer Translation Mapping list is created in the lower pane. Multiple Layers can be mapped to the same target Layer. This mapping is then applied with the "Translate" button, and/or saved to a drawing standards file (DWS) with the "Save" button. Layer Mappings loaded from a DWS automatically populate the Layer Translation Mappings pane.

Translated Layers take on the properties of the destination Layer. Mapped Layers are removed from the current drawing. The "Map same" button can be used to map all current Layers to Layers of the same name, effectively changing their properties to match the target Layer properties.

The "Settings..." button gives you even more control over Layer translation.

The default settings allow you to change the properties of objects on a Layer to Color ByLayer and Linetype ByLayer during translation. Objects nested within blocks are also translated.

You can cause the Layer Translator to display the contents of each Layer as you're remapping (similar to the old Layer Walk Express Tool).


At 11:57 AM , Anonymous Anonymous said...

Is there a batch layer converter to use on multiple dwgs at one time?
A layer converter that remembers the layers to convert and layers to convert to?
So one does not have to pick the same layers in multiple dwgs to convert.

At 11:34 PM , Blogger Ward Romberger said...

Great question. Unfortunately, and this is becoming more and more prevalent, Autodesk failed to include a command line version of LAYTRANS (typically -LAYTRANS) which could be scripted against multiple drawings. They do provide a report via the Batch Standards Checker that will tell you which of the target drawings require attention.

However, all is not lost. You can sort of get the scriptable command line version if you're willing to do a little LISPing. I'm not very ARX savvy, but I did a cursory test with this method and it seemed to work. Caveat emptor. Your script nugget would need to load the translay arx and then execute the laytrans function against a saved drawing standards file (create this file with the dialog version of LAYTRANS). Your nugget might look something like this:

(arxload "LAYTRANS.ARX")
(acet-layrans "laytrans.dws" 0)

where "laytrans.dws" is the name and location of the standards file (use forward slashes to separate folders instead of backslashes), and 0 is a required bit code. My problem is that I don't know what bit codes this function takes; however 0 (zero) seems to work. (Can anyone provide more light on this?)

Use a tool like Autodesk's ScriptPro to apply this script nugget to a list of drawings, and you're in business. Good luck, and if I can help with any particulars, don't hesitate to contact me.

At 3:42 PM , Anonymous Anonymous said...


The bits are as follows:

* bit = 1: Force color to Bylayer
* bit = 2: Force linetype to Bylayer
* bit = 4: Translate into blocks
* bit = 8: Write the translation log file

(acet-laytrans "standard.dws")
Uses the previously saved file "standard.dws" (which contains layer mappings) and the last used options.

(acet-laytrans "standard.dws" (+ 1 2))
Uses the previously saved file "standard.dws" and forces color and linetype to BYLAYER.

(acet-laytrans "standard.dws" (+ 1 2 8))
Uses the previously saved file "standard.dws", forces color and linetype to BYLAYER and writes a translation log.

At 4:10 PM , Anonymous Anonymous said...

I just used the bit codes above and the key is to have a space behind each the plus sign and each number, then it works.


At 4:22 PM , Anonymous naturat said...

this was a great find.... however I'd like to point out that when using bit values, you don't need to do the (+ 1 2 4 8 ) etc... you can simply add them manually if you want. For example (+ 1 2 4) is the same as simply writing 7 without the "(", ")" or the "+".

At 7:45 PM , Anonymous Anonymous said...

I have been using Layer Translator in 2006. Is there a way to upgrade this file to 2009 - so avoiding entering all the same info again?

At 3:02 AM , Anonymous PDF signature said...

I am always a fan of the method that involve Pictorial representation of any information or explanation supported by images.Good post and the way of presentation is also impressive.Keep it up

At 3:03 AM , Anonymous PDF signature said...

I am always a fan of the method that involve Pictorial representation of any information or explanation supported by images.Good post and the way of presentation is also impressive.Keep it up


Post a Comment

Subscribe to Post Comments [Atom]

<< Home