@theoryshaw Good news and bad news.
The good one is that now It works with sub-aggregates. The bad one is that I was working in a branch that was outdated related to BB main development, and I got this error when I tried to work on a more up-to-date branch. Also, I haven't fully yet managed to get openings working.
Really cool work! Do you think it would be possible to make this work with an IFC array too? Use case would be a truss made out of an IfcElementAssembly/IfcBeam. Because at the moment it is not possible to IFC Array an empty, the modifier menu won't show op in the Blender UI. Or is there a hacky way around it? Maybe @theoryshaw knows?
It's not possible at the moment. There's still some work to be done, I'm going to try to improve the refresh so that it only updates objects that were changed, as discussed here: https://github.com/IfcOpenShell/IfcOpenShell/pull/3328
However, to make it work with IfcArray would require a lot of changes in how arrays work right now. Maybe it will be better to create an equivalent that works only with aggregates. In the long run, I think there should be a set of operations just to deal with this, like an Aggregates Manager or something, where you could create duplicates, arrays, see how many instances an aggregate have, etc.
like an Aggregates Manager or something, where you could create duplicates, arrays, see how many instances an aggregate have, etc.
I like this idea a lot for many reasons...
I am clueless how the IFC array currenlty works, but I am making the assumption it stores the transformation information in a propertyset of one the elements and somehow memorises the relations with the other ifc elements in the same array? through overlapping guids? Could you try to explain it to me please in a simple way? :-)
If this all could work, this would be a huge time saver and would definitely a way better solution than all proprietary software solutions I know about.
I'll explain my understanding of it, but I might miss some details. It creates a Pset that stores the info that you put in the IfcArray UI. Then it duplicates the original objects as many times as the "count" property and the position is calculated based on the "x", "y" and "z". All the copies have the "Parent" guid stored. If you have "Sync Children" selected, it will delete all children e recreate them, every time you edit the array. This is not the best solution, because it will do this even if the original object hasn't changed.
If I read this correctly, I can see an IfcElementAssembly can also have an IfcPropertySet.
Yes. The duplicate aggregate feature also uses a Pset similar to IfcArray. I had some success building this, but there are still a lot of things about IFC that I don't fully understand. Any help and suggestion are welcome!
I just watched this clip above, there is a really weird workflow with parenting a plane and arraying a collection which doens't include an array at all but vertices instancing. I managed to make a basic working example with a Blender collection. Clueless on how to store all of this in IFC.
Just was playing around with object instancing in Blender, somehow if this could translate to an IfcElement Assembly and IFC array modfier that would be so great.
But I don't know how. I feel it should be doable.
Just thinking out loud here.
How to do this in native IFC?
You could store XYZ points in native IFC to work as a reference for an IFC element assembly array? That way you can store the transformation information of the assembly array in a propertyset of that point? instead of having to choose one element of the assembly?
Is it even possible to store a propertyset on a ifcpoint? if you make it an ifcbuildingelementproxy?
I would advise you not to spend too much time with the vertex instancing workflow, this feature will be removed in 4.0 which will come in a few months.
The preferred workflow will be to use a Geometry Nodes setup, I guess old setups will be automatically converted. Although I doubt we'll have something as straightforward as it is now...
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:
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?
Comments
related: https://github.com/IfcOpenShell/IfcOpenShell/issues/3101#issuecomment-1558264231
a little error on duplicate.
https://www.dropbox.com/s/kjmxeb285a9timl/2023-05-24_07-46-19_Blender_blender.mp4?dl=0
Scratch that... i can't seem to replicate this again. hmm.
Thanks for testing. I haven't been able to develop this for a while, but I think I'll get back to it next week.
@theoryshaw Is this related? https://github.com/IfcOpenShell/IfcOpenShell/issues/3186
It is. Troubleshooting that too, currently.
Here i was able to consistently replicate an error.
https://www.dropbox.com/s/r1uh6nhag2ejsfm/2023-05-24_08-47-39_Blender_blender.mp4?dl=0
@bruno_perdigao Possible to push your work on aggregates? It's base functionality works nicely, in my view.
@theoryshaw There is a small refactor to be done, I think I'll finally have the time this weekend. Then I'll try to work on improvements
@theoryshaw Good news and bad news.
The good one is that now It works with sub-aggregates. The bad one is that I was working in a branch that was outdated related to BB main development, and I got this error when I tried to work on a more up-to-date branch. Also, I haven't fully yet managed to get openings working.
@bruno_perdigao
Really cool work! Do you think it would be possible to make this work with an IFC array too? Use case would be a truss made out of an IfcElementAssembly/IfcBeam. Because at the moment it is not possible to IFC Array an empty, the modifier menu won't show op in the Blender UI. Or is there a hacky way around it? Maybe @theoryshaw knows?
It's not possible at the moment. There's still some work to be done, I'm going to try to improve the refresh so that it only updates objects that were changed, as discussed here: https://github.com/IfcOpenShell/IfcOpenShell/pull/3328
However, to make it work with IfcArray would require a lot of changes in how arrays work right now. Maybe it will be better to create an equivalent that works only with aggregates. In the long run, I think there should be a set of operations just to deal with this, like an Aggregates Manager or something, where you could create duplicates, arrays, see how many instances an aggregate have, etc.
@bruno_perdigao
I like this idea a lot for many reasons...
I am clueless how the IFC array currenlty works, but I am making the assumption it stores the transformation information in a propertyset of one the elements and somehow memorises the relations with the other ifc elements in the same array? through overlapping guids? Could you try to explain it to me please in a simple way? :-)
https://standards.buildingsmart.org/MVD/RELEASE/IFC4/ADD2_TC1/RV1_2/HTML/annex/annex-d/reference-view/ifcelementassembly.htm
If I read this correctly, I can see an IfcElementAssembly can also have an IfcPropertySet.
If this all could work, this would be a huge time saver and would definitely a way better solution than all proprietary software solutions I know about.
I'll explain my understanding of it, but I might miss some details. It creates a Pset that stores the info that you put in the IfcArray UI. Then it duplicates the original objects as many times as the "count" property and the position is calculated based on the "x", "y" and "z". All the copies have the "Parent" guid stored. If you have "Sync Children" selected, it will delete all children e recreate them, every time you edit the array. This is not the best solution, because it will do this even if the original object hasn't changed.
Yes. The duplicate aggregate feature also uses a Pset similar to IfcArray. I had some success building this, but there are still a lot of things about IFC that I don't fully understand. Any help and suggestion are welcome!
https://blenderartists.org/t/how-to-apply-array-on-collection/1216565/8
It seems Blender also has no support for using a modifier array on a collection. :-(
I wish someone could prove me wrong.
I just watched this clip above, there is a really weird workflow with parenting a plane and arraying a collection which doens't include an array at all but vertices instancing. I managed to make a basic working example with a Blender collection. Clueless on how to store all of this in IFC.
Found another way of collection instancing,
Just was playing around with object instancing in Blender, somehow if this could translate to an IfcElement Assembly and IFC array modfier that would be so great.

But I don't know how. I feel it should be doable.
Just thinking out loud here.
How to do this in native IFC?
You could store XYZ points in native IFC to work as a reference for an IFC element assembly array? That way you can store the transformation information of the assembly array in a propertyset of that point? instead of having to choose one element of the assembly?
Is it even possible to store a propertyset on a ifcpoint? if you make it an ifcbuildingelementproxy?
I would advise you not to spend too much time with the vertex instancing workflow, this feature will be removed in 4.0 which will come in a few months.
The preferred workflow will be to use a Geometry Nodes setup, I guess old setups will be automatically converted. Although I doubt we'll have something as straightforward as it is now...
https://devtalk.blender.org/t/remove-legacy-instancing/28028
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
@walpa Maybe try with
bpy.ops.bim.add_constr_type_instance(ifc_class="IfcElementAssemblyType", relating_type_id=id_tip, from_invoke=True)
?Thanks @Gorgious
Moving to another thread so as not to mess this one up.
@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?
See here: https://github.com/IfcOpenShell/IfcOpenShell/pull/3328
crtl + shift + d
@bruno_perdigao , @theoryshaw Works well ! Thanks for the great contribution.
@walpa Nice to hear you are testing it. Let me know if you have any feedback.
@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: https://www.dropbox.com/scl/fi/e13b2t13rgegevavr67r0/2023-09-06_22-00-01_KeyShowView_Carnac.mp4?rlkey=7m0yvuiw4926ijb2g4e59qulz&dl=0
file: https://gitlab.com/openingdesign/highland_haven/-/blob/743360162c6a8e8f285d5d57e077c00303afb828/Models_and_CAD/BlenderBIM/Highland_Haven.ifc
@theoryshaw I think it’s a bug. I’ll take a closer look later to find out
@theoryshaw https://github.com/IfcOpenShell/IfcOpenShell/pull/3732 Let me know if works when it's merged.
still seems glitchy, unfortunately.
https://www.dropbox.com/scl/fi/fhdjaj6jfgp2bvgqcf800/2023-09-08_08-02-27_Blender_blender.mp4?rlkey=u0ost16c9anojqj4yuws9dkz3&dl=0