Graph viewer of IFC structure in Bonsai: Interested? Features?

Hi Community,

I am updating my suite of educational tools to teach uni students about open BIM concepts,
Among them I have created
https://github.com/jakob-beetz/ifcopenshell-notebooks
https://github.com/jakob-beetz/IfcOpenShellScriptingTutorial/
and other stuff over the years.
As I had used have been using Blender(BIM) in education for a long time and am thinking of rolling all of this into Bonsai.

Such a graph viewer comes in handy to understand and debug models, get insights etc.
I am not sure how interesting this might be to you.
If it is, I will clean the code, add some features and put it in a separate repo (it creates additional dependencies, and I'd rather not pollute Bonsai with a PR with it...)
Things on my agenda:

  • Interaction (click on a node, get the selection in Blender)
  • All attributes and on the node labels
  • auto-focus
  • UI elements for graph recursion depth, ENTITY blacklists etc.

Any thoughts?
Thanks for any comments and suggestions

Jakob

theoryshawbruno_perdigaoKoArasteverugitlangNigelzoomerwalpaMassimoJohnand 10 others.

Comments

  • I still consider myself a novice with IFC, so such a tool would be great!

    Jakob
  • um, awesome.

    Jakob
  • This is a good visualization of the fact that IFC is an entity relationship model.
    I have used this software to visualize IFC files. Since it is open source, I will introduce it to you. Please translate as it is in Japanese.
    https://github.com/kiyuka829/ifc-graph-viewer

    John
  • This tool as another tab in the WebUI? How about it?

    John
  • @walpa said:
    This tool as another tab in the WebUI? How about it?

    Thanks, this is a really good idea

    John
  • I want it!

  • Hi guys thanks for the feedback!

    Here is a first draft. Let me know if this works for you. Not sure about the installation on other platforms http://graphviz.org must be installed on your platform.

    https://github.com/jakob-beetz/bonsaiGraph

    walpaGerardTc4rlosdiasKoAraDimitrisAce
  • fantastic!

  • @Jakob I just give your graph tool a try - really nice.
    I had to tweak the code for an IFC4x3 model, otherwise, no issues at all. Super cool feature.
    Thanks

    Jakob
  • edited May 2025

    @Rick_Brice said:
    @Jakob I just give your graph tool a try - really nice.
    I had to tweak the code for an IFC4x3 model, otherwise, no issues at all. Super cool feature.
    Thanks

    Hi @Rick_Brice , thanks a lot for the feedback!
    I'd be very happy to learn more about and incorporate your IFC4x3 tweaks. I have a few (cosmetic) updates and could add your modifications. Pull Request or some snippets here ... whatever works best for you. I also had a brief conversation with @dionmoult discussing some options to add this to the debug panel in bonsai itself and/or createing a WebUI panel with some nicer SVG rendering, interactivity etc. as @walpa suggested.

    Jakob

    NigelJohn
  • @Jakob all i did was change the hard coded IFC4 to IFC4X3 in init.py
    I think the ‘ifcopenshell.file.schema’ property gives the schema of the open file so maybe this works instead of hard coding. I haven’t tried it yet.

  • @Jakob Thank you for this awesome tool—it's perfect for an IFC schema newbie like me! 🙂
    I've been searching for something like this for a long time, and I finally found it.
    Unfortunately, I’m having trouble installing it. No matter what I try (manually install Numpy), I always end up (when I try to enable Graph in Bonsai) with the following error:
    No module named 'numpy.exceptions'

    Here’s my system setup:
    Windows 10
    Blender 4.3.2
    Bonsai 0.8.2
    Numpy 2.3.1

    Could you help me resolve this issue?
    Thank you in advance

    Ifc & Python Newbie🙂

  • No module named 'numpy.exceptions'

    What's the output of the following:

    import numpy
    print(numpy.__file__)
    
  • Thanks, @aothms. Blender is returning this path:
    C:\Program Files\Blender Foundation\Blender 4.3\4.3\python\Lib\site-packages\numpy__init__.py
    But I'm not sure what that means.

  • I also tried downgrading Numpy to v1.26.4, but it didn't work?

  • edited October 2025

    Hi @Jakob ,
    I find this project really useful, some notes on the packages from a cross-platform perspective:

    • on Windows the installation is a breeze, instantly works as expected
    • on my Mac (Apple Silicon), the graphviz package is not working, it is not officially built for ARM: "We are close to having an installable graphviz-arm64.pkg. You can build it yourself, but there are unresolved details like code signing." I also had trouble building it myself.
    • BonsaiGraph falls back to netgraph, which I can install to be available for Blender's Python, but it renders the connections in a weird way, completely different to Windows – this is not comprehensible for the attribute graph:

    On a different note, the attribute relationship graph is not showing Property Sets attached to IfcGroups, even if I increase the recursion depth to the maximum value of 10. Is this something that would need to be implemented, or I miss something? (I've created a few objects and put them into an IfcGroup and attached a dummy Pset to the group: the objects and the group itself is shown, but not the Pset. (Psets attached to the objects themselves appear as expected.)

    CSN
Sign In or Register to comment.