Skip to main content
Question

Writing multiple features dynamically to dwg


bjudes
Enthusiast
Forum|alt.badge.img+10

Hi

I am trying to write to dwg dynamically. I have 5 different features River, Pond, Canal, Canal Lock and Canal Harbour. I want to merge the 3 canal features (Canal, Canal Lock and Canal Harbour) into Canal and then write dynamically so I get a single DWG file with River, Pond and Canal, but of course I get the Canal Lock and Canal Harbour now under the alias of Canal. Is this possible, hope it makes sense?

Thanks

B

2 replies

davideagle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • October 23, 2018

Hi @bjudes, if by 'features' you mean featuretypes or layers, called Canal, Canal Lock and Canal Harbour then there is a nice identifier you can use to help. Put an AttributeExposer on the canvas and expose the attribute fme_feature_type, now add an AttributeValueMapper and set it up so that when fme_feature_type is equal to "Canal Lock", replace it with "Canal". You could also use an AttributeManager with a conditional statement for this or say a Tester to look in the fme_feature_type attribute using a regex, where the string is ^Canal, which filters off everything that you can then use an AttributeCreator to set the fme_feature_type to the new layer name.

If however, your features are individual objects then you'll need to look for another identifier to filter them on like the autocad_block_name which you can then use to ultimately adjust the fme_feature_type attribute. When the feature hits the writer with the new fme_feature_type value it will be written to the new layer name.

Hope that helps, Dave


bjudes
Enthusiast
Forum|alt.badge.img+10
  • Author
  • Enthusiast
  • October 25, 2018
davideagle wrote:

Hi @bjudes, if by 'features' you mean featuretypes or layers, called Canal, Canal Lock and Canal Harbour then there is a nice identifier you can use to help. Put an AttributeExposer on the canvas and expose the attribute fme_feature_type, now add an AttributeValueMapper and set it up so that when fme_feature_type is equal to "Canal Lock", replace it with "Canal". You could also use an AttributeManager with a conditional statement for this or say a Tester to look in the fme_feature_type attribute using a regex, where the string is ^Canal, which filters off everything that you can then use an AttributeCreator to set the fme_feature_type to the new layer name.

If however, your features are individual objects then you'll need to look for another identifier to filter them on like the autocad_block_name which you can then use to ultimately adjust the fme_feature_type attribute. When the feature hits the writer with the new fme_feature_type value it will be written to the new layer name.

Hope that helps, Dave

 

Thanks Dave, this worked perfectly. You are a great help. B

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