Intro tutorial for parsing IFC files with IfcOpenShell and Python

This forum section is only for IFC-related issues
Post Reply
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Intro tutorial for parsing IFC files with IfcOpenShell and Python

Post by Moult »

I recently wrote a short introductory tutorial for parsing IFC files with IfcOpenShell and Python on my blog here:

https://thinkmoult.com/using-ifcopenshe ... ython.html

I thought users on this forum might find it useful as an introduction. It's a really simply library and great for querying IFC files to check if their contents are correct.

Enjoy! :)
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Intro tutorial for parsing IFC files with IfcOpenShell and Python

Post by yorik »

Amazing tutorial! Did the ifcopenshell people see it?
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Intro tutorial for parsing IFC files with IfcOpenShell and Python

Post by Moult »

I suspect that they did, as I crossposted this on the building smart forums, and @aothms (ifcopenshell main dev) liked the post :)

https://forums.buildingsmart.org/t/shor ... shell/1021
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Intro tutorial for parsing IFC files with IfcOpenShell and Python

Post by bernd »

oh Yeah

I really like it too.
3D_GeoSpatialEng
Posts: 1
Joined: Thu Aug 15, 2019 7:44 am

Re: Intro tutorial for parsing IFC files with IfcOpenShell and Python

Post by 3D_GeoSpatialEng »

Great to read such positive feedback, however I cannot get the tutorial started on my macOS 10.14 while using PyCharm as IDE.
What am I doing wrong?
- Pathways?
- Interpreter / environment / version?

Please any advice, I have also opened a topic on SO:
https://stackoverflow.com/questions/575 ... or-further
User avatar
Moult
Posts: 321
Joined: Sat Jan 05, 2019 11:46 am
Contact:

Re: Intro tutorial for parsing IFC files with IfcOpenShell and Python

Post by Moult »

YouGood morning 3D_GeoSpatialEng!

You have not sufficiently described your scenario for us to give useful feedback. Let's start with the basics - you will need to run a python interpreter and import the ifcopenshell program.

Can you try the following, and describe exactly what you are doing, and what happens on the computer as a result (be sure to include any error messages exactly as they are shown).

1. Forget PyCharm for a moment, go and open up a new terminal.
2. Run the "python" command - if successful, it should start an interactive interpreter where you can start typing in python code. It will also tell you what version of python you have: please tell us what this version is.
3. If the python command is successful, can start typing, such as "print('foo')" and press enter and it will result in the message "foo" being displayed. if that works, try typing "import ifcopenshell" and press enter. If successful, there will be no message. If it fails, it will say something like module not found. Let us know.
4. If it says it cannot find the ifcopenshell module, type in "import sys", press enter. This would should work and not display any success message. Then type "sys.path" and press enter. You should tell us exactly what this command outputs.

Feel free to contact me on https://mastodon.social/@thinkMoult for more rapid responses, or on the #freecad or ##architect channel on irc.freenode.net. I also use XMPP.
I also blog about 3D rendering, architecture, software and other on thinkMoult.com. RSS / Atom feed available for your convenience.
Post Reply