Skip to main content
Question

Extract Layers from multiple DXF Files and store it in new File


Forum|alt.badge.img

Hi,

I have a lot of DXF Files in different folders. The DXF files have all the same layers.

I don´t need every layer of the files for my work. So I want to read every DXF file, filter the layers which I need, summarize them to different groups and store them in a new file.

How can I built such a workbench?

Thanks and best regards.

 

 

 

11 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 3, 2019

hi @joe_gerner,

For reading all of the files from different locations see the advanced reader parameters (this enables you to set a filter to read only .dxf files)

And the Merge Filter option in the feature type parameters to filter the data to read only the one layer you need from all the files

See the section about merging traffic in this blog post: https://www.safe.com/blog/2011/05/fmeevangelist80/

Hope this helps,

Itay


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • September 3, 2019

@joe_gerner

You can use a reader in dynamic form to read content of folder filtered on .dxf.

Filtering as you said.

Howto requires a sample dxf.


Forum|alt.badge.img
  • Author
  • September 4, 2019

Thanks for your advise, but how can I store every dxf as a single file? I want to read all dxf files at once,filter the layers but store them all as seperat files

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 4, 2019
joe_gerner wrote:

Thanks for your advise, but how can I store every dxf as a single file? I want to read all dxf files at once,filter the layers but store them all as seperat files

 

For that you can use the writer fanout, which will produce a file per value of the attribute used. Make sure the fme_basename attribute is exposed in the reader and use it in the writer fanout:


Forum|alt.badge.img
  • Author
  • September 13, 2019
joe_gerner wrote:

Thanks for your advise, but how can I store every dxf as a single file? I want to read all dxf files at once,filter the layers but store them all as seperat files

 

Hi, I tried your advise but I have a problem. With your settings FME creates only one file with the name "fme_basename.dxf". But I want a way to split the dxf files and get them their original name. If I use only "fme_basename" without ".dxf" as fanout expression I get the seperat files, but without a file ending. How can I change this?


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 13, 2019
joe_gerner wrote:

Hi, I tried your advise but I have a problem. With your settings FME creates only one file with the name "fme_basename.dxf". But I want a way to split the dxf files and get them their original name. If I use only "fme_basename" without ".dxf" as fanout expression I get the seperat files, but without a file ending. How can I change this?

Hi @joe_gerner,

My mistake you should use the format attribute value like this:

This way you get the value of the fme_basename (your file name) and not fme_basename (literally)


Forum|alt.badge.img
  • Author
  • September 23, 2019
itay wrote:

Hi @joe_gerner,

My mistake you should use the format attribute value like this:

This way you get the value of the fme_basename (your file name) and not fme_basename (literally)

Thank you, for your help. Now it works


Forum|alt.badge.img
  • Author
  • September 23, 2019

One last question to this topic. I want to group different layers and store them under a new group name. How can I manage this?

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 23, 2019
joe_gerner wrote:

One last question to this topic. I want to group different layers and store them under a new group name. How can I manage this?

 

Hi @joe_gerner,

I would look into the autocad_group format attributes. Although I am not sure the DWG/DXF writer supports them....

Make sure all your layer have the same value for each group.


Forum|alt.badge.img
  • Author
  • September 23, 2019
itay wrote:

Hi @joe_gerner,

I would look into the autocad_group format attributes. Although I am not sure the DWG/DXF writer supports them....

Make sure all your layer have the same value for each group.

Do I have to select them in the reader or the writer? and how can I change the name of the different groups?

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • September 23, 2019
joe_gerner wrote:

Do I have to select them in the reader or the writer? and how can I change the name of the different groups?

 

mmm, according to the documentation the autocad_group entity is only supported by the reader, but since they are available in the writer feature type, you can try to set the autocad_group attributes to your values e.i. use an AttributeManager or ArrtibuteCreator to give them values and don't forget to expose them in the writer feature type (see previous image)

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings