Have I stepped on the .blend vs .ifm landmine?

edited November 2025 in General

Hi all,
Yesterday I happened to spot a warning in the Bonsai docs about not relying on the .blend file, load and save the .ifc only to ensure the .ifc remains correct. A quick search turned up lots of discussion about the files getting out of sync.
Unfortunately, early on in developing a model of a house I'm working on I found that each time I started a new blender session and loaded my .ifc all my objects would be, within the organiser in the default (Ground) story collection. It didn't matter if I'd cloned an object & moved it to another storey or created it directly on another storey, everything ended up in the default Storey collection after loading the .ifc in a new blender session. In the 3D view everything was where is should be. Loading a .blend did not have that problem, my heirarchy in the organiser is preserved.
Now, I know I should have dug deeper back then but I didn't :-( I may (I hope) have saved myself from having to start again because even though I open the .blend each session I have been saving both the .ifc and the .blend at every stage as I moved along.
So, what is the correct way to get collections to work (as I believe they should?) in the .ifc file?
Even a blank project has a totally flat heirarchy in the organiser. This seems to be a recent change, in the BlenderBim version of IFC Architect's lesson1 there is logical heirarchy, My Story is created within My Building which is created within My Site which is created within My Project (@1:42):

But in the Bonsai version of that lesson My Storey, My building and My Site are all created flat within My Project (@1:21):

Any help and guidance greatly appreciated!
Thanks
Julian

Comments

  • Yes, that sync problem is an issue.

    I did not understand it fully but @theoryshaw recently told me that that there still is a (fragile!) sync option - by saving the blend file. Not sure but then it will save the Blend and IFC files if I got that correct (?)

    Therefore, until I really understand that, I avoided saving any Blend file from a Bonsai IFC - to not accidentally get a hidden sync between both files.
    I think this is likely what you may have provoked by :

    have been saving both the .ifc and the .blend at every stage as I moved along.

    So I only save the IFC File by CTRL+S and do not touch CMD+s.
    And when I open an IFC project, I always load it in a new Blend File (coming from my StartupBlend File), not by opening the IFC from inside a Blend File saved from an IFC project.

    Could you try to only open and save the IFC from Bonsai - and test if this way, your IFC Story assignments will stay.

  • My guess is rather you have assigned the storey by changing the collection the objects are assigned to, but that is not enough for bonsai. For Bonsai to write the relationship in the ifc you need to change the assignment in project tab by choosing the container and clicking on the assign button. Objects will jump to the different collection automatically.
    Regarding the browser structure, there was a discussion that the user should be able to change it to reflect any kind of hierarchy in the ifc, but I am not sure this has been adopted yet.

    zoomer
  • Thank you both.
    You are correct I think @JanF, I found a similar technique to that you suggest. In Project Overview -> Spatial Decomposition I set one of my created stories to be the default for new elements. Then select an element on the wrong storey and in Object Information -> Spatial Container the current container is shown but as soon as I click on the pencil to edit it the spatial container changes to the one I've set as default. Click the tick and all is done. Repeat for all elements that need to be moved (not forgetting the openings) and my building is corrected.
    I'm still working on how I get the Site, Building and Stories in the correct heirarchy.

  • You need to select the object, go to object properties and under aggregates reassign the parent.

  • I've just been watching Dion's Introduction to OpenBIM, Native IFC, and Open Source AEC video and I'm not sure now why my Site, Building, Stories heirarchy is wrong.
    https://www.youtube.com/watch?v=h2Rv9iu7yDk
    At 23:49 he shows that IfcRelAggregate is the class that links these entities. In my .ifc I have:
    #49=IFCRELAGGREGATES('21giBtrmTErAl8su0XCKWH',$,$,$,#1,(#31));
    #55=IFCRELAGGREGATES('2vcLw_rI1FFxM1V3l_hz6C',$,$,$,#31,(#37));
    #61=IFCRELAGGREGATES('16c_GuBbbE$AL8WHm4h$mQ',$,$,$,#37,(#43,#1824,#1846,#1802));
    Where
    #1=IFCPROJECT('3R6WiEl_HFKvX6xxayQkwQ',$,'My Project',$,$,$,$,(#14,#26),#9);
    #31=IFCSITE('3dIDrxMmTBi9oWIEcMCsmR',$,'My Site',$,$,#54,$,$,$,$,$,$,$,$);
    #37=IFCBUILDING('2M999pUMP4YfztbdnAMV1F',$,'My Building',$,$,#60,$,$,$,$,$,$);
    and #43, #1824, #1846 & #1802 are my storeys.
    These relationship classes all appear correct yet in the overview my building and stories are directly within 'My Project'

  • Some time ago, this hierarchy was removed in the outliner.
    Was discussed here, where @sjb007 provides a link to another discussion, which i will repeat here..

    from @Moult ....

    Flexible collections and new spatial manager

    In previous versions, the way of managing the spatial tree was done in the outliner. This had a number of limitations. For larger projects, you'd end up with very, very long lists of objects and it wasn't possible to get an understanding of what objects you actually had, or even how many storeys or spaces you had. Instead you had to collapse and expand collections and manually filter and count to get an understanding of larger spatial trees. Another problem is that it took away the flexibility of Blender's collection system: you couldn't have objects assigned to multiple collections, and you couldn't ad-hoc create or reoganise custom collections for temporary grouping and visibility like regular Blender. This led to lots of bugs unless you knew the exact rules of what could be nested in what. It also blurred the lines between spaces / objects groups, versus aggregate / subelement groups. In IFC4X3, other relationships like covers or nesting is increasingly common, which would lead to very deep, nested spatial trees. This deep nesting and collection-based way of managing the tree also meant load, save, and drawing generation times were unnecessarily long, and had a risk of creating "sync" bugs.

    A huge change has been made to how the spatial tree is managed to address all of this. There is a new spatial decomposition panel with friendly icons, showing only the spatial structure. A split panel below shows elements contained within the active space, grouped into types with counts per class and type. At a glance, you can now see more meaningful results like "I have X storeys", and "X walls on level 2". There are also dedicated buttons for isolating spaces and toggling visibility, and quickly selecting elements within a space (recursively and non-recursively). Previously, you'd have to scroll constantly, and use up to 3 possible visiblity controls to achieve the same thing.

    You can now also create new spaces from the spatial panel. These also filter only to valid subspaces. For example, it doesn't allow you to create a bridge inside a room, but it does allow you to place a road on a site. It also has separate dedicated search filters for spaces and elements. These search filters search not only for names, but also long names. Previously, especially for rooms which only have room numbers or buildings with short codes, it was difficult to quickly search for room names or building descriptions, but now you can do it.

    This also leads to faster drawings, load, save, and less bugs.

    Users can now also set a "Default Container". Previously, new objects were created in whatever collection was active in Blender and contained in whatever IFC element that correlated to. Unless you are a Blender whiz, it isn't clear where your objects are being added to, or if it's valid or not. Now, your nominated "Default Container" is where all new objects end up in, and impacts things like where new walls are drawn to.

    This big change means that managing spaces must now be done in this new panel. Reorganising and using multiple non-IFC collections in the outliner is now completely decoupled and freeform for your own organisation and won't change (or break) your IFC structure. For those who wish to create their own session-specific workflows, this is a big win.

    Massimo
  • MasMas
    edited November 2025

    here a pic of some tooltipps for spartial, latest versions of blender and bonsai: (hard to read here, but in the software)

  • @theoryshaw & @Mas,
    You are both absolute stars, thank you so much. You've clarified what has changed, explained why the change was done (which helps me remember so much better than the mere what) and how I move forward working with the changed UI. Brilliant.
    Bonus - I now know objects can be assigned to multiple collections (todo: read up on how), this is something I have use cases for.
    Thank you again
    Julian

  • edited November 2025

    Bonus - I now know objects can be assigned to multiple collections (todo: read up on how), this is something I have use cases for.

    Can you elaborate on your use cases please ?
    Never really understood that Collection's feature so far. I just misuse them as (nested) Layers only.

    And especially how it plays together with Bonsai/IFC. Or was it only meant for

    Reorganising and using multiple non-IFC collections in the outliner is now completely decoupled and freeform for your own organisation and won't change (or break) your IFC structure.

    only ?

    This deep nesting and collection-based way of managing the tree also meant load, save, and drawing generation times were unnecessarily long, and had a risk of creating "sync" bugs.

    So Blend + IFC sync is in reach again ? Not ?

  • As an example of my use case I've been wondering if there's a way to 'tag' items as part of the thermal envelope of my building. This would allow me to hide everything except thermal elements then fly around inside the model looking for gaps. Items like the internal wall insulation would already exist across multiple storey containers and I wouldn't want to lose that relationship in order to build my thermal envelope collection. Now it seems, once I'm ready, the functionality is there.
    Another thing I've learned during today's trip down the .ifc schema rabbit hole is the existence and reason for the existence of IfcRelReferencedInSpatialStructure as distinct from IfcRelContainedInSpatialStructure:
    https://standards.buildingsmart.org/IFC/RELEASE/IFC4/FINAL/HTML/link/ifcrelreferencedinspatialstructure.htm
    Which is precisely what I'll be needing for my IWI.
    Happy.

  • Thanks for your example, now I understand the use case.

    It took a while but I think I also understand the meaning of a "IfcRelReferencedInSpatialStructure".
    Something that Archicad had but Vectorworks has not. Parts spanning through multiple Stories. Like if a 3-story Column in an atrium that sits on Entrance Level, in VW it would not appear in the other floor plans. If you copy it instead to the other Stories, it would appear tripple in calculation and so on ....
    Learned something new today.

  • edited November 2025

    please see my video here
    what is the current sequence in the new UI?
    thanks

    OK that's easy

    1. select container/storey
    2. select object(s)
    3. click on the 'chain' icon

    you can see the reference after:

    JanFMastheoryshawtlang
Sign In or Register to comment.