IFC information extraction

Hi,everyone!
I work with a module that extract usefull information from IFC files for IOT deployement in smart building.
I want to ask you what extraction technics could be more effecient to work with or do you any idea about this (information extraction from IFC ) ?

Hey @samiba6 are you after a programming library that can help you extract data from an IFC?

If so I’d highly recommend http://ifcopenshell.org/ - don’t be fooled by the sparse website, it’s open source, cross platform, incredibly advanced, supports Python and C++, unique in that it provides very comprehensive high level IFC manipulation APIs, and I’ve trained people in using it in about an hour even from zero programming knowledge.

Here’s a crash course: https://wiki.osarch.org/index.php?title=IfcOpenShell_code_examples

Github is here: GitHub - IfcOpenShell/IfcOpenShell: Open source IFC library and geometry engine

Let me know if I can help in any way :slight_smile:

3 Likes

Hi @Moult thank you very very much, I was lost in the various available programming software and I had to post up here to pick the appropriate one to work on, so here you gave me the best possible choice.

hi again @Moult i tried to install work with the library but it does work out .
i tried this link a link i found on thinkmoult website but it doesnt open for me !
I will be grateful if you can show me how to set the library.
Thanks have a good day !

Have you considered Using the Python console with BlenderBIM Add-on - Wiki.OSArch ? It is a super easy way to get started and experiment. Later on if you want to be more advanced you can copy the packaged Python module into your own Python installation.

2 Likes

hey @Moult thanks for the idea of using Blender as learning tool , i did it and i exprinced on the crash course it is so useful for begginers , now i want to take myself the next level i want to code with visual studio, can u help me out with any ressources that i can learn how to copy the packaged Python module ?
PS : i tried the Anaconda method but it didnt work with me it stucks at this commande :

$ conda install -c conda-forge -c oce -c dlr-sc -c ifcopenshell ifcopenshell

thanks a lot for supporting this great library !

From personal experience I can confirm what Moult said. It is compeltely feasable to code a python script with BIMOpenShell to extract any data you want from IFC models in a structured way. It’s also possible to push new data into existing IFCs that way, but it’s a bit more tricky…

Unfortunately, I can’t share the entire script for data extraction (company data), but I can give you some pointers, what functions could be useful for you if you plan to extract only properties in property sets:

  • List all the elements/products: ifc_file.by_type(‘IfcElement’)
  • To check what type a product in IFC is: product.is_a()
  • Check also for types of definitions: definition.is_a(‘IfcRelDefinesByProperties’)
  • And definition’s relating properties: definition.RelatingPropertyDefinition
  • You can list all the properties with their data: relating_property_def.HasProperties

Then you’d need to formulate your data structure and use other python modules to get into your IOT software in the correct format.

Note that other IFCOpenShell functions also cover geometry data, so if you’re interested, also look into that.

Good luck and let us know if you succeed!

1 Like

hey @cesnik_jure !
thank you very much, it helped me a lot, I will keep you informed of the news of my project.
best regards ,
Samy.

Sorry for the late reply. You can just copy the Python module from the blender add-ons directory, blenderbim/libs/site/packages/ifcopenshell and paste it in your Python site-packages folder (find out where using import sys then print(sys.path) - this will work assuming your Python is also version 3.9.

1 Like