Import geometry straight from IFC

I just found this beautiful piece of art on the blogspot page of @c.poupin .
https://voltadynabim.blogspot.com/2022/10/dynamo-python-visualiser-un-ifc-avec.html
A great solution for importing IFC geometry directly into Dynamo. I had often wondered if this would be possible. I hardly dare to ask, but would it also be possible to pre-filter the IFC categories. You should then be able to import only the IFC categories you are interested in.

3 Likes

Hi @MJB-online

Hi,
Ifc scheme use Classes,

instead of
products = self.ifc_file.by_type('IfcProduct')
you can use
doors = self.ifc_file.by_type('IfcDoor')

3 Likes

Hi @c.poupin,

thank you very much for your response.
I’ve tried your suggestion, but it doesn’t seem to make a difference. I still get “all” geometry from the IFC model in Dynamo.
But I have also discovered that the outcome is not a geometry that can be reused in Dynamo (solids/polysurfaces).
My ultimate goal would be to select different IFC classes (IfcWall, IfcSlab, IfcStair), grab the solids or polysurfaces of those IFC classes, and export it to a SAT file.

oh yes indeed, if you have a little knowledge of DataTables you can add an IfcClass column and filter the datatable with this column, I will post an example if necessary

Hi,
if you are not familiar with DataTables, another simpler method if filtering only on classes

replace this line

if not element.is_a('IfcSite') and not element.is_a('IfcOpeningElement') :

by

if element.is_a() in ['IfcSlab', 'IfcDoor']:

5 Likes

Hi @c.poupin,

I was still sweating :sweat_smile: on your previous suggestion, but that is unfortunately way beyond my knowledge of Python.
But this last change is also doable for me.
Thank you very much and keep up the Python magic :slightly_smiling_face:.

2 Likes

If there are more people who would like to visualize IFC geometry directly in Dynamo, check out the links below as well.

Installation of Ifc Open Shell:
https://voltadynabim.blogspot.com/2022/08/dynamo-python-eparpillement-dun-ifc.html
Install Python Modules (NumPy):
https://forum.dynamobim.com/t/how-to-install-python-modules-in-dynamo-core-runtime-2-8-0/52922/54

4 Likes