W
by walpa on 10 Aug 2023
#
For my use case, shown here, I need to create type assemblies (IfcElementAssemblyType) for the precast concrete elements (20 different types) and instantiate copies (IfcElementAssembly) for the individual elements (32 modules x 36 elements).
It's not exactly an array because the types can vary from one module to another and different types can appear in the same module.
Using existing types in BIMTool (such as IfcWallType) I can via script using the commands:
id_tip = 123 #id IfcWallType from ifc file
bpy.context.scene.BIMModelProperties.ifc_class = 'IfcWallType'
bpy.ops.bim.add_constr_type_instance(relating_type_id=id_tip, from_invoke=True)
But for IfcElementAssemblyType it's not working.
Do you know of any way to do this?
Please forgive me if it's not related to the subject of the discussion.
Thanks
G
by Gorgious on 13 Aug 2023, edited 13 Aug 2023
#
@walpa Maybe try with bpy.ops.bim.add_constr_type_instance(ifc_class="IfcElementAssemblyType", relating_type_id=id_tip, from_invoke=True)
?
W
by walpa on 14 Aug 2023
#
Thanks @Gorgious
Moving to another thread so as not to mess this one up.
W
by walpa on 19 Aug 2023
#
About the functionality, this is how it works:
- Once you have all the elements in one assembly, you have to select only the empty that has the IfcElementAssembly class. Then press "ctrl+F"* to duplicate, and you will be able to move the new copy.
@bruno_perdigao I'm trying to test it, but in the latest version (blenderbim-230818) "crtl+F" is not doing anything.
In @theoryshaw's video I couldn't identify the shortcut keys he used.
Can you show me how to do it?
T
by theoryshaw on 19 Aug 2023
#
See here: https://github.com/IfcOpenShell/IfcOpenShell/pull/3328
crtl + shift + d
W
by walpa on 20 Aug 2023
#
+1 votes
@bruno_perdigao , @theoryshaw Works well ! Thanks for the great contribution.
B
by bruno_perdigao on 21 Aug 2023
#
@walpa Nice to hear you are testing it. Let me know if you have any feedback.
T
by theoryshaw on 7 Sep 2023
#
@bruno_perdigao
Is there something I'm missing in the following steps?
After 'refresh aggregate' I wouldn't expect those objects to be relocated like that.
video:
file: https://gitlab.com/openingdesign/highland_haven/-/blob/743360162c6a8e8f285d5d57e077c00303afb828/Models_and_CAD/BlenderBIM/Highland_Haven.ifc
B
by bruno_perdigao on 7 Sep 2023
#
@theoryshaw I think it’s a bug. I’ll take a closer look later to find out
B
by bruno_perdigao on 8 Sep 2023
#
@theoryshaw https://github.com/IfcOpenShell/IfcOpenShell/pull/3732 Let me know if works when it's merged.
T
by theoryshaw on 8 Sep 2023
#
still seems glitchy, unfortunately.
T
by theoryshaw on 8 Sep 2023
#
I think i know what it's related to... after I created the aggregate, I moved the origin of the aggregate empty.
T
by theoryshaw on 8 Sep 2023
#
Should the movement of the aggregates' origin be accommodated? or should it always remain at 0,0,0?
B
by bruno_perdigao on 8 Sep 2023
#
Is it the same file you shared before? Did I do anything different here?

B
by bruno_perdigao on 8 Sep 2023
#
@theoryshaw said:
I think i know what it's related to... after I created the aggregate, I moved the origin of the aggregate empty.
It takes into account the location and rotation of the original objects in relation to the original empty. Then it reproduces the same relationship based on the duplicate empty position and rotation. Here's what happens when you change it:

B
by bruno_perdigao on 12 Sep 2023
#
@theoryshaw Any updates on this? The PR didn't solve your problem after all?
T
by theoryshaw on 19 Sep 2023, edited 19 Sep 2023
#
+1 votes
Hi @bruno_perdigao Just saw this, sorry.
I'm keeping the aggregate empty at (0,0,0), and it seems to work.
...
As you saw, there's this problem.
...
Also, as a feature request, would it be possible to increment the duplicates?
So instead of...
-
IfcElementAssembly/Assembly (original)
-
IfcElementAssembly/Assembly.001 (duplicate)
-
IfcElementAssembly/Assembly.002 (duplicate)
It changes the name to something like...
-
IfcElementAssembly/Assembly (original)
-
IfcElementAssembly/Assembly_1 (duplicate)
-
IfcElementAssembly/Assembly_2 (duplicate)
Reason being, when they are named with .001
etc, upon a reopening of the IFC, these aggregates get renamed. That is IfcElementAssembly/Assembly.001
could be renamed to IfcElementAssembly/Assembly
, for example.
This makes in confusing, when adding stuff to the original (or parent) aggregate--as the name essentially always changes, when the IFC is opened again.
Hope that makes sense.
A
by Andrej730 on 19 Sep 2023, edited 19 Sep 2023
#
It takes into account the location and rotation of the original objects in relation to the original empty. Then it reproduces the same relationship based on the duplicate empty position and rotation. Here's what happens when you change it:
I think I've met similar problem - when you move the entire assembly (relation between original objects and empty doesn't change), "refresh assembly" still moves the objects.
Demo - https://imgur.com/a/5g345O2
Example to reproduce the issue attached (just run "Aggregate Refresh" on the second assembly")
Update! Just noticed the pull request and it solves the issue for me. Can we merge it or there is still something to add? @bruno_perdigao
B
by bruno_perdigao on 19 Sep 2023
#
@Andrej730 Let me take a look at these new issues to see if they are related. Then I'll try to add everything into a single PR
B
by bruno_perdigao on 19 Sep 2023
#
+1 votes
@Andrej730 I changed my mind, since this PR is simple and already solved your issue, I think you can merge it. The other issues are related to another part of the code.
T
by theoryshaw on 19 Sep 2023
#
The following scenario doesn't seem to refresh.
Am I missing something, or is this just not possible currently.
file attached.


B
by bruno_perdigao on 20 Sep 2023
#
The refresh seems to be working as intended, but the instances are not organized the way as you expected (see below). I suspect the problem happened when you were duplicating them. Do you recall the order in which you created them?

T
by theoryshaw on 20 Sep 2023
#
I meant to do the following as a pull request
https://github.com/IfcOpenShell/IfcOpenShell/commit/9e67565c71bbe3d0ea45302674345f47572ed874
It's easier just selecting a part, verses trying to track down the aggregate empty, to refresh.
T
by theoryshaw on 20 Sep 2023, edited 20 Sep 2023
#
+1 votes
@bruno_perdigao said:
The refresh seems to be working as intended, but the instances are not organized the way as you expected (see below). I suspect the problem happened when you were duplicating them. Do you recall the order in which you created them?
hmm, not sure i quite follow you. See following video
I'm not sure where you got D
and E
from.
T
by theoryshaw on 21 Sep 2023, edited 21 Sep 2023
#
Sorry for the onslaught of feature requests. Just using the 'duplicate aggregate' a lot lately so just want to write them down somewhere. :)
...
Possible to have 'duplicate aggregate' work with arrays?
video: