Question

Easiest way to create attributes in shapefile based on attributes from autocad dwg?

  • 13 March 2022
  • 2 replies
  • 13 views

Currently I run a testfilter that checks the name of a fme_feature_type which has layer names from the drawing.

So basically my testfilter is full of if statements like

"if @value(fme_feature_type) LIKE %P-STM-MH" and output each if statement to its own output port (Ie 'Manholes' or 'Storm Mainline'). from there i run an attribute creator on each output. the attributecreator looks at the field_name and i add it to a field in my shapefile but named differently. So if field_name is STM-MH its added as an attribute in my shapefile as 'Storm Manhole'

Is there a more efficient way of doing this vs what im doing? I feel like I'll have a lot of layers and there for a lot of outputs where I might need to run 10+ attribute creators.

If theres a better way of doing this I'd love to know it. Thanks

testfilter 


2 replies

Badge +4

Hi @traviss​ ,

you can try the AttributeValueMapper (disadvantage -> you can only choose one source attribute) or you can do all in one AttributeCreator/AttributeManager with conditional values (filter + new attribute). You get lesser Transformers, but also lesser overview of what you are doing in the workflow. Maybe you can combine fme_feature_type + field_name to a new column and then use the AttributeValueMapper.

Userlevel 4

You can use conditionals directly in the AttributeManager or AttributeCreator, see https://s3.amazonaws.com/gitbook/Desktop-Advanced-2019/DesktopAdvanced1Attributes/1.04.ConditionalValues.html

That way you'd only need a single AttributeManager/Creator and no TestFilter.

Reply