Hi @freddy17,
There are a few key steps to extracting partially misnamed property sets:
1. Use a GeometryPropertyExtractor with no Geometry Xquery to extract all the geometry names. If there are more than one (and there always are in IFC), the names will end up in a list named _geometry_name{}. This will need to be exposed in an AttributeExposer, since the GeometryPropertyExtractor only exposes the single attribute, not the list.
2. Explode the _geometry_names list into separate geometry names, then use a FeatureMerger to merge with the desired property set name from Excel. Use a FuzzyStringComparer to compare the geometry name to the desired property set to see if they are close enough.
3. Use a second GeometryPropertyExtractor to extract the close matches. Set the Geometry XQuery to This Part - GeometryName - like - _geometry_name attribute. This will extract only the traits from the matched property set.
The AttributeExposers are static, and can't currently adapt to the input data, so they should only be used to expose attribute you know will be present, and that you want to manipulate in the workspace.
For ensuring the other extracted attributes are included in the schema of the output format, you can take the Schema feature from FeatureReader and manipulate it to include the attributes listed in the Excel file. This feature is then sent to a Dynamic mode writer, along with the data features, to control the output schema.
I am attaching a modified workspace to illustrate this process in greater detail.
AttrExposer_safe.fmw
Hi @freddy17,
There are a few key steps to extracting partially misnamed property sets:
1. Use a GeometryPropertyExtractor with no Geometry Xquery to extract all the geometry names. If there are more than one (and there always are in IFC), the names will end up in a list named _geometry_name{}. This will need to be exposed in an AttributeExposer, since the GeometryPropertyExtractor only exposes the single attribute, not the list.
2. Explode the _geometry_names list into separate geometry names, then use a FeatureMerger to merge with the desired property set name from Excel. Use a FuzzyStringComparer to compare the geometry name to the desired property set to see if they are close enough.
3. Use a second GeometryPropertyExtractor to extract the close matches. Set the Geometry XQuery to This Part - GeometryName - like - _geometry_name attribute. This will extract only the traits from the matched property set.
The AttributeExposers are static, and can't currently adapt to the input data, so they should only be used to expose attribute you know will be present, and that you want to manipulate in the workspace.
For ensuring the other extracted attributes are included in the schema of the output format, you can take the Schema feature from FeatureReader and manipulate it to include the attributes listed in the Excel file. This feature is then sent to a Dynamic mode writer, along with the data features, to control the output schema.
I am attaching a modified workspace to illustrate this process in greater detail.
AttrExposer_safe.fmw
Hi Dave, thank you for your detailed description. I am glad that I was not completely barking up the wrong tree! The steps you have provided makes sense, and I am starting to get the just of it.
There is still one part, that confuses me:
After extracting the Traits with the second GeometryPropertyExtractor, it extracts the GlobalId in my workspace from the custom Pset GlobalId. This has the result that the featureMerger does not match the two GlobalIds, because the GlobalID in the IfcSpace differs to it Original Attribute GlobalID. When writing to Excel, I have the exposed Traits (Pset Properties), but the Values are not set. Is there a setting that I am missing, or how do I get the Parent global ID so that I can merge the desired property set in a feature merger. I tried to use the GeometryExtractor on the Parent,
Hi Dave, thank you for your detailed description. I am glad that I was not completely barking up the wrong tree! The steps you have provided makes sense, and I am starting to get the just of it.
There is still one part, that confuses me:
After extracting the Traits with the second GeometryPropertyExtractor, it extracts the GlobalId in my workspace from the custom Pset GlobalId. This has the result that the featureMerger does not match the two GlobalIds, because the GlobalID in the IfcSpace differs to it Original Attribute GlobalID. When writing to Excel, I have the exposed Traits (Pset Properties), but the Values are not set. Is there a setting that I am missing, or how do I get the Parent global ID so that I can merge the desired property set in a feature merger. I tried to use the GeometryExtractor on the Parent,
Hi @freddy17,
Thanks for catching that. I have added an AttributeRenamer to the workspace to rename the GlobalID to org_GlobalID, and adjusted the FeatureMerger to use it instead. This should prevent the link from being overwritten by the GeometryPropertyExtractor. I have updated the workspace in the main answer as well.
AttrExposer_safe.fmw
Hi @freddy17,
Thanks for catching that. I have added an AttributeRenamer to the workspace to rename the GlobalID to org_GlobalID, and adjusted the FeatureMerger to use it instead. This should prevent the link from being overwritten by the GeometryPropertyExtractor. I have updated the workspace in the main answer as well.
AttrExposer_safe.fmw
Thanks Dave, this has really helped me a lot. The next steps that I will take is to do a similar dynamic expose but with the Attribute Names. Are there any good FME Tutorials / Webinars that will help mastering Dynamic Inputs?
Cheers
Fred
Hi @freddy17,
There are a few key steps to extracting partially misnamed property sets:
1. Use a GeometryPropertyExtractor with no Geometry Xquery to extract all the geometry names. If there are more than one (and there always are in IFC), the names will end up in a list named _geometry_name{}. This will need to be exposed in an AttributeExposer, since the GeometryPropertyExtractor only exposes the single attribute, not the list.
2. Explode the _geometry_names list into separate geometry names, then use a FeatureMerger to merge with the desired property set name from Excel. Use a FuzzyStringComparer to compare the geometry name to the desired property set to see if they are close enough.
3. Use a second GeometryPropertyExtractor to extract the close matches. Set the Geometry XQuery to This Part - GeometryName - like - _geometry_name attribute. This will extract only the traits from the matched property set.
The AttributeExposers are static, and can't currently adapt to the input data, so they should only be used to expose attribute you know will be present, and that you want to manipulate in the workspace.
For ensuring the other extracted attributes are included in the schema of the output format, you can take the Schema feature from FeatureReader and manipulate it to include the attributes listed in the Excel file. This feature is then sent to a Dynamic mode writer, along with the data features, to control the output schema.
I am attaching a modified workspace to illustrate this process in greater detail.
AttrExposer_safe.fmw
Hi Dave,
is it possible for you to reupload the workspace (AttrExposer_safe.fmw)?
Thanks
nel
Hi Dave,
is it possible for you to reupload the workspace (AttrExposer_safe.fmw)?
Thanks
nel
Hi @nel, the workspace has been reattached to the original comment (: