Question

Replacing layer name, autocad_layer, in a dwg and write.

  • 18 October 2019
  • 2 replies
  • 74 views

Badge +1

 

HI, I have a dwg file with a lot of layers which can be seen in Civil 3D:

 

Not every Layer have a block entitiy in it yet

I am trying to rename layername in FME, but I am

 

1. Very unsure on how to set up my reader, since there are many options and parameters to choose form when reading a dwg file, I can choose to open per Layername or geometry etc, this is the settings I have now which just shows up as "<All>" and chose Autocad dwg/dwf as reader

I DO NOT whant to change specific entities layername, which is the setting now, the problem is that some layers do not have entities so only the number of entities are read and I can choose "autocad_layer" and see that value but only for 3 layers.

 

I want to read in ALL layernames, and use a attributemanager and say if layername="T-KST" rename to "Roads" for example and be able to do that for all my layer names (and possible the description of the layer) which can be seen to the right in the first image. Is there any way at all to do this so I can write as a dwg again and see my replaced layer names in Civil 3D?


2 replies

Userlevel 4
Badge +26

This is a bit of a challenge, You might get some responses on a smart way to do this, however, as you've found FME tends to work on entities rather than the Layer.

 

 

What you will probably want to do is create a Template dwg file with the layer names you want in the output. It doesn't matter if this file contains data or not as FME can just use it as a template (keeping the styles, layer configuration and block library). This means you can delete layers and/or rename layers into the way you want for your output.

 

 

Then you can build your FME workflow as you mentionted above, renaming the autocad_layer on the entities to put them into the correct layer defined in the template. The empty layers will still be there with the same styles.

 

 

It does take a little time to set up, however, with only 60 layers or so it might still be quicker to do it this way then trying to figure out how to build a script for it.

 

 

Check out this article for some more info: https://knowledge.safe.com/articles/29869/working-with-the-dwgstyler.html
Badge

Use a Creator then a Feature Reader to read-in the CAD file and then an attribute filter to provide access to the layer names. Then to output, use a test filter to capture the layers you might want to consolidate such as "Roads" and "Road" and link to a feature writer where you can specify the layer names you want. If you are keeping all the layers then you just map them 1:1 feature reader to writer and alter new layer name in the writer.

 

Reply