Skip to main content

Hi Everyone,

 

My Question:

I am trying to read the Pset of an ifc dynamically. I have looked at a few sources in the forum but have not been able to manage.

 

I would love some help on this topic. I have read a few articles on Dynamic Schemas and Updating Ifcs etc:

https://knowledge.safe.com/articles/594/updating-ifc-example.html

https://knowledge.safe.com/articles/1136/schemamapper-transformer-tutorial.html

https://knowledge.safe.com/questions/32777/how-to-expose-all-attributes-in-generic-way-any-ma.html

 

My aim is to expose part of a custom ifcpropertyset that are created by an external user. I will know the naming convention, but I want to be able to use Regex or some sort of fuzzy match to catch the Pset incase there has been a mistake in the creation of these Propertysets.

 

For example if the Custom Pset is called "Pset_Project", I would like to expose it and all its Traits.

But I want to make sure that if someone writes "Pset_prject" or "Pset_project1", that I can still continue with using an attribute exposer and hope that my FME workspace will not stop. I would like to avoid hard coding anything, Ideally a form of regex would make sense? AttributeExploder is not really an option as I would like to keep the inherent .ifc Structure.

 

The goal is to use the custom propertyset and items for additional Evaluations and Calculation in FME. The data Output will most probably be in csv or excel format. Maybe I am missing something? Can this issue be solved with Schema mappers? I am not sure where to start.

 

I have attached a file of a few options that I have tried out.

 

Regards

Fred

3D RH - BadlyNamedPset.zip

 

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.

screen-shot-2020-06-25-at-22841-pmAttrExposer_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.

screen-shot-2020-06-25-at-22841-pmAttrExposer_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.

screen-shot-2020-06-25-at-22841-pmAttrExposer_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 (:


Reply