Skip to main content
Solved

Is it possible to look for layer names in a DWG based on a wildcard search?


Hey folks, I am brand new to FME script writing. I have for example, a DWG with sewer, water and electrical lines. The layer names are usually all the same except with unique numbers.

 

eg. HET-32434-WAT

or HET-23422-WAT-SER

or HET-232345-ELEC

etc

 

I am trying to output each of the categories into their own shape files so I can simply point my script to a dwg and run it. I have no problem doing this manually by adding the DWG into my workspace where it asks me what layers to load into the workspace and I can point those to an attribute creator and output a shapefile. That works fine, I am just trying to figure out how I can have it look in a DWG drawing I specify for the layer names like %WAT% to output all my waterlines into a shapefile.

 

Hopefully I made sense here.

 

Thanks

Best answer by redgeographics

traviss wrote:

Hey thanks, I've been looking documentation / articles on how to work with the merged file. I have a basic understanding that it creates a fme_feature_type that I should be able to use to look for specific layers in the dwgand outputting them to their relevent lines or points shapefile. Im certain this is probably a common task I just cant seem to find the articles.

 

Thanks again.

Yes, the fme_feature_type attribute will contain the original feature type name (layer name in case of most CAD formats), in addition to that in many cases there will be a format-specific attribute as well. For DWG that'll be acad_layer_name. They may not be visible but you should be able to find them in for example the attributes list of a Tester or TestFilter (and if not you can always use an AttributeExposer to make them visible).

View original
Did this help you find an answer to your question?

3 replies

redgeographics
Celebrity
Forum|alt.badge.img+49

Yes, you can use the Merge Feature Types option with wildcards or regular expressions:

Screenshot 2022-03-10 at 14.15.06


  • Author
  • March 11, 2022

Hey thanks, I've been looking documentation / articles on how to work with the merged file. I have a basic understanding that it creates a fme_feature_type that I should be able to use to look for specific layers in the dwgand outputting them to their relevent lines or points shapefile. Im certain this is probably a common task I just cant seem to find the articles.

 

Thanks again.


redgeographics
Celebrity
Forum|alt.badge.img+49
  • Celebrity
  • Best Answer
  • March 11, 2022
traviss wrote:

Hey thanks, I've been looking documentation / articles on how to work with the merged file. I have a basic understanding that it creates a fme_feature_type that I should be able to use to look for specific layers in the dwgand outputting them to their relevent lines or points shapefile. Im certain this is probably a common task I just cant seem to find the articles.

 

Thanks again.

Yes, the fme_feature_type attribute will contain the original feature type name (layer name in case of most CAD formats), in addition to that in many cases there will be a format-specific attribute as well. For DWG that'll be acad_layer_name. They may not be visible but you should be able to find them in for example the attributes list of a Tester or TestFilter (and if not you can always use an AttributeExposer to make them visible).


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