[BlenderBIM] Re-inventing the array modifier in Blender to make it suitable for copying of IFC elem

The array modifier in Blender is really useful for creating brick walls, beam system arrays, stairs etc....
However for example when I want to create a beam system array with IfcBeamType instances, it's ofcourse just copying the meshes in Blender instead of the actual IfcBeamType instances.

Is it possible with a python script to redefined the array modifier in Blender but make it IFC ready?
I can't imagine it being that hard to script, because all it would it just copy paste the IfcElementType instances and add a transformation in the X Y or Z level.....? Or am I completely underestimating this task?

Or does something similar already exist?

Screenshot of what I would like to achieve:


  • This is on the todo list. It isn't that hard, but since we are adding semantics on top of IFC, we have to decide the best way to do so. So far I'm leaning towards a dumb approach where we simply invent our own array convention and store the data in a pset. This is a simple agnostic approach that can work for any "generated" geometry.

    If you help write a function that 1) defines a clear signature of what settings an array might have (probably inspired by Blender's array modifier, but probably only support absolute offsets), 2) applies those settings to a single "parent" element (e.g. the first beam), and does the necessary copying and matrix transformations, and 3) saves the settings and the GlobalIds of the "children" elements as a dictionary, and 4) loads potentially changed settings, checks against currently tracked children and deletes/adds/moves as necessary then that would be super, super helpful. I can help polish it and integrate it to the rest of the modeling tools and create a UI for it.

  • edited October 2022

    That's nice, is it true IfcMappedItem could be then used to store the data in IFC for an array?

    EDIT: I think @brunopostle also looked into this subject for the home-maker add-on?

  • @Coen in theory IfcMappedItem could be used, but I am increasingly against it, and would prefer instancing to only happen for type occurrences. It's just such an unsemantic way of sharing critical geometry data that makes native authoring hard.

    Mapped items used outside types are also perhaps one of the aspects of IFC that almost everybody goes "what why is geometry so hard and overengineered".

  • @Coen homemaker does arrays, but with the same kind of 'dumb' approach that @Moult suggests. In IFC the number of ifcbeam elements in the file is the number of beams in the building, this is a fundamental property of the file format that has advantages and disadvantages (it makes generating a bill of quantities really easy, but makes things like repeated identical storeys hard).

    For parametric arrays, all the generated elements need to be included in the file, along with enough stashed information that will allow them to be removed and recreated whenever a parameter (eg spacing) changes.

  • @brunopostle Do you have an example of an array in homemaker you can share with us?
    @yorik Do you guys codify arrays into IFC?
    Would be nice to align an approach, one we can perhaps suggest back to BuildingSmart?

  • @theoryshaw homemaker arrays are just multiple type instances, the spacing etc.. is defined in the style definition which is external (not recorded in the IFC). They can be regenerated with different parameters, but only when the whole building is regenerated.

  • in freecad too, arrays are just series of instanced elements. we've tried to gather them into an IfcElementAssembly, which is what we increasingly do because it's convenient, your whole structure can be manipulated as one object, but the inner components remain available. I wish there were more diverse types of assemblies than the basic generic one... The parameters of the array, though (the interval distance and orientation of the array axes) are lost. We could find a way to store them in custom properties, though

  • @yorik any object can act as an aggregate, you're not limited to IfcElementAssembly.

  • @Moult said:
    @yorik any object can act as an aggregate, you're not limited to IfcElementAssembly.

    This is one of my boggles. I have aggregated a series of IFCWALL elements within a parent IFCWALL, which seems ok, especially if they are chained together. "How many walls does this building have?" is not a very interesting question, "how much wall?" is more relevant.

    But then I have a series of three columns and aggregate them within an IFCOLUMN. There are now four IFCOLUMN's in the file (but there are only three columns). This seems like a case where the aggregate should be IFCELEMENTASSEMBLY.

  • @Moult true... I should use that more often actually.

  • Is it possible to selecte multiple items for one array?

  • @Coen said:

    Is it possible to selecte multiple items for one array?

    I don't think so. I think because of...

  • The problem I see with the mapped groups / arrays is as follows: if only the parametric repetition is stored in the IFC file ("this group exists also at this location") then the actual occurrences have to be created at runtime by the application, right? It would be hard to maintain occurence data like GUID and overriden psets.
    If the occurrences are persisted in the file then the application has to take care of the replication ("keep those groups in sync").
    Both ways, if opening the file with a non full native ifc application would show a completly different project (as it already does now if you use grid placement).

  • Hello. The IFC Array look great! However it seems a bit buggy when duplicating the Array Parent Object: you can edit the array on its duplication. Would be great if Shift+D duplicates the Array Parent Object + its Children Items, making it an independent Array.

  • Hello, I'm back on the IFC Array tests. When I edit the Count field I have this bug:

    With: blenderbim-230116-py310-win
    Model :

  • @RaphaëlVouilloz said:
    Hello, I'm back on the IFC Array tests. When I edit the Count field I have this bug:

    With: blenderbim-230116-py310-win
    Model :

    I have the exact same bug.

  • @SigmaDimensions has helped fix this bug :) Thanks!

  • Yes, that works, thanks! Another cool trick would be that changing the Construction Type of the parent object of the Array also updates the items. E.g. for beams

Sign In or Register to comment.