C
by Coen on 16 Oct 2022, edited 24 Jan 2024
#
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:

M
by Moult on 16 Oct 2022
#
+1 votes
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.
C
by Coen on 16 Oct 2022, edited 16 Oct 2022
#
@Moult
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?
M
by Moult on 16 Oct 2022
#
+1 votes
@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".
B
by brunopostle on 16 Oct 2022
#
+1 votes
@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.
T
by theoryshaw on 16 Oct 2022
#
@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?
B
by brunopostle on 16 Oct 2022
#
@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.
Y
by yorik on 17 Oct 2022
#
+2 votes
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
M
by Moult on 17 Oct 2022
#
@yorik any object can act as an aggregate, you're not limited to IfcElementAssembly.
B
by brunopostle on 17 Oct 2022
#
+1 votes
@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.
Y
by yorik on 17 Oct 2022
#
@Moult true... I should use that more often actually.
C
by Coen on 27 Oct 2022
#

Is it possible to selecte multiple items for one array?
T
by theoryshaw on 27 Oct 2022
#
+2 votes
@Coen said:

Is it possible to selecte multiple items for one array?
I don't think so. I think because of... https://twitter.com/theoryshaw/status/1585654686878760962
T
by tobenz on 27 Oct 2022
#
+2 votes
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).
R
by RaphaëlVouilloz on 17 Nov 2022
#
+2 votes
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.

R
by RaphaëlVouilloz on 17 Jan 2023
#
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 :
C
by Coen on 17 Jan 2023
#
@"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.
T
by theoryshaw on 17 Jan 2023
#
+2 votes
same. added here: https://github.com/IfcOpenShell/IfcOpenShell/issues/2708
M
by Moult on 25 Jan 2023
#
+1 votes
@SigmaDimensions has helped fix this bug :) Thanks!
R
by RaphaëlVouilloz on 25 Jan 2023
#
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
B
by bruno_perdigao on 24 Mar 2023
#
Hi everyone,
Is it possible to give a rotation to the array modifier?
In this example, I have an element that is rotated. I would like to create an array that has the same orientation and would look like this:

But it seems that the array only works with the global coordinates, like this:

For my use case, this is easy to do manually, but I was wondering if this is possible to implement.
M
by Moult on 24 Mar 2023
#
Yes, can you help file a bug? Basically we should have a setting between local axes and global axes :)
B
by bruno_perdigao on 5 Apr 2023
#
+3 votes
I was playing with the code from the array modifier and I came up with two features that I found useful, I would like to know what you guys think:
1 - Choose between "increment" and "total" for the input values:

2 - Get 3d cursor location as input. This is useful when you want to use other object as reference:

@Moult, if you think it's useful, I would like to work on a PR.