[SOLVED] Help needed: How to run ifc2json from Python with ifcOpenShell

This forum section is only for IFC-related issues
Post Reply
mickey58
Posts: 3
Joined: Sat Feb 20, 2021 4:12 pm

[SOLVED] Help needed: How to run ifc2json from Python with ifcOpenShell

Post by mickey58 »

I'm a beginner with Python, IFC, and ifcOpenShell. As I'm very experienced in Javascript, I'd like to explore how to convert between JSON and IFC, using the ifcJSON package from buildingSmart on https://github.com/buildingSMART/ifcJSON.

I have followed the install instructions on https://github.com/buildingSMART/ifcJSO ... converters, which resulted in a working ifcOpenShell environment from my Python shell. As positive verifcation: After entering "import ifcopenshell" in my Python shell, I am able to execute simple ifcOpenShell commands from my shell's command prompt.

However, I would like to run ifc2json.py (one of the ifcJSON commands) with some test files. I don't know how to achieve this. After executing the above "ifcJSON installation instructions", my Python shell seems to be still unaware of ifcJSON, it is only enabled for ifcOpenShell.

So my simple question is: What am I missing to add ifcJSON to ifcOpenShell? Any advise from more experienced people in this forum would be greatly appreciated.

Update: I got this working by cloning the ifcjson repository manually from GitHub, for now running the ifc2json commands from there.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: [SOLVED] Help needed: How to run ifc2json from Python with ifcOpenShell

Post by Kunda1 »

Care to share what you're working on?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
mickey58
Posts: 3
Joined: Sat Feb 20, 2021 4:12 pm

Re: [SOLVED] Help needed: How to run ifc2json from Python with ifcOpenShell

Post by mickey58 »

Well, my end goal is to export building physics related attributes from my app written in Node/Javascript for import in other BIM tools (popular CAD and procurement software).

In the oher direction, I'm most interested in exporting geometric data from popular CAD software and import it into my web app.

I'm still in an early exploration phase for the above. Since my app can already import and export JSON, I thought that ifcjson might help me with the above tasks.

I'm not limited to ifcjson though. Any tools that can help with the above are welcome. Since I'm new to IFC and its tools (which seem to be built mainly around C# and Python, not JS), I'd be happy to get some adivse which routes to explore. I'm aware it is not just a tooling question, but touches custom property sets and many other exciting topics.
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: [SOLVED] Help needed: How to run ifc2json from Python with ifcOpenShell

Post by lalberts »

did you try osarch.org ?
probably find some help also there.
Lukas
mickey58
Posts: 3
Joined: Sat Feb 20, 2021 4:12 pm

Re: [SOLVED] Help needed: How to run ifc2json from Python with ifcOpenShell

Post by mickey58 »

@lalberts - thanks for this pointer. OSArch.org seems like a window to another exciting new world, OSS & BIM coming together.

But I didn't find anything there yet that would help me with my original question, converting between JSON and IFC. However, I spent only 20 minutes there.
lalberts
Posts: 87
Joined: Fri Feb 05, 2016 2:40 pm
Location: Esslingen am Neckar

Re: [SOLVED] Help needed: How to run ifc2json from Python with ifcOpenShell

Post by lalberts »

just ask there..
Post Reply