Skip to main content
Solved

Using XML to filter IFC

  • February 4, 2019
  • 7 replies
  • 101 views

Hello,

I created a model view definition for IFC files. I exported it as XML and would like to apply the rules that I defined in the model view definition to an IFC file. I would like to filter an IFC file to include only the information that i described in my XML. What would be the best way to approach this topic?

Best regards

Tobias

Best answer by takashi

Firstly you have to parse the XML document to retrieve required IFC class name and geometry type name as feature attributes. The XML reader and/or some XML transformers such as the XMLFlattener etc. would help you to do that. A concrete solution depends on the XML schema and which element/attribute value should be retrieved.

Then, in order to read only IFC features belonging to a specific class, the FeatureReader might help you. You can set an attribute storing an IFC class name (e.g. IfcWall) read from the XML to the Feature Types to Read parameter in the FeatureReader.

This workflow is a possible way to filter the IFC features by its geometry type according to an attribute value read from the XML. Assuming that the initiator feature contains attributes storing an IFC class name and geometry type name which have been read from the XML.

 

Hope this helps.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

takashi
Celebrity
  • February 4, 2019

By what do you intend to filter the IFC features? For example, should compare an attribute of each IFC feature to a value read from the XML?


  • Author
  • February 5, 2019

Thank you for this question.

First I want to filter the IFC to only include the classes that I include in my XML.

Secondly, some IFC can have for example several geometric representations. I want to filter them to only include the geometric representation I included in my XML (e.g. surface geometry)

I attach two pictures showing an example model view definition for IFC wall, maybe this is helpful.

Thank you very much


takashi
Celebrity
  • Best Answer
  • February 6, 2019

Firstly you have to parse the XML document to retrieve required IFC class name and geometry type name as feature attributes. The XML reader and/or some XML transformers such as the XMLFlattener etc. would help you to do that. A concrete solution depends on the XML schema and which element/attribute value should be retrieved.

Then, in order to read only IFC features belonging to a specific class, the FeatureReader might help you. You can set an attribute storing an IFC class name (e.g. IfcWall) read from the XML to the Feature Types to Read parameter in the FeatureReader.

This workflow is a possible way to filter the IFC features by its geometry type according to an attribute value read from the XML. Assuming that the initiator feature contains attributes storing an IFC class name and geometry type name which have been read from the XML.

 

Hope this helps.


  • Author
  • February 8, 2019

Firstly you have to parse the XML document to retrieve required IFC class name and geometry type name as feature attributes. The XML reader and/or some XML transformers such as the XMLFlattener etc. would help you to do that. A concrete solution depends on the XML schema and which element/attribute value should be retrieved.

Then, in order to read only IFC features belonging to a specific class, the FeatureReader might help you. You can set an attribute storing an IFC class name (e.g. IfcWall) read from the XML to the Feature Types to Read parameter in the FeatureReader.

This workflow is a possible way to filter the IFC features by its geometry type according to an attribute value read from the XML. Assuming that the initiator feature contains attributes storing an IFC class name and geometry type name which have been read from the XML.

 

Hope this helps.

Thank you very much, this has been very helpful.


  • Author
  • March 25, 2019

Firstly you have to parse the XML document to retrieve required IFC class name and geometry type name as feature attributes. The XML reader and/or some XML transformers such as the XMLFlattener etc. would help you to do that. A concrete solution depends on the XML schema and which element/attribute value should be retrieved.

Then, in order to read only IFC features belonging to a specific class, the FeatureReader might help you. You can set an attribute storing an IFC class name (e.g. IfcWall) read from the XML to the Feature Types to Read parameter in the FeatureReader.

This workflow is a possible way to filter the IFC features by its geometry type according to an attribute value read from the XML. Assuming that the initiator feature contains attributes storing an IFC class name and geometry type name which have been read from the XML.

 

Hope this helps.

@takashi I have a follow up question. I build a workbench in a very similar way:

The filtering is working as intended (i needed some extra steps before merging). When I take a look at my inspector I can see that the Ifc has been filtered to only include a single wall and the wall only includes surface geometries:

The problem I encounter now is that when i write the filtered Ifc back to Ifc, it does for some reason not include Min and Max Extents and all coordinates:

Can the write maybe not write surface geometries? I tried to work with the GeometryCoercer and different geometries but this did not fix the problem. Do you have an idea how to fix this issue or what might be causing it? The inspector after the FeatureMerger includes all previsios Ifc information.

Thank you and best regards

Tobias

 


takashi
Celebrity
  • March 25, 2019

Firstly you have to parse the XML document to retrieve required IFC class name and geometry type name as feature attributes. The XML reader and/or some XML transformers such as the XMLFlattener etc. would help you to do that. A concrete solution depends on the XML schema and which element/attribute value should be retrieved.

Then, in order to read only IFC features belonging to a specific class, the FeatureReader might help you. You can set an attribute storing an IFC class name (e.g. IfcWall) read from the XML to the Feature Types to Read parameter in the FeatureReader.

This workflow is a possible way to filter the IFC features by its geometry type according to an attribute value read from the XML. Assuming that the initiator feature contains attributes storing an IFC class name and geometry type name which have been read from the XML.

 

Hope this helps.

Try setting geometry name to 'Body' before writing with the GeometryPropertySetter.


  • Author
  • March 26, 2019

Try setting geometry name to 'Body' before writing with the GeometryPropertySetter.

Now it is working, thank you very much again!