A
by Andrej730 on 21 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.
Hmm, it's now not refreshing aggregate if it's just IfcElementAssembly selected. Was it intended? Intuitively it seems that it should still work. And for the cases if you have assembly of assemblies you won't be able to refresh the main assembly by other ways besides selecting the main IfcElementAssembly empty.
Noticed another idea similar to that PR - when you add object to an assembly with eyedropper, perhaps it should be possible to select assembly child object and it would deduce actual IfcElementAssembly from that child. And not sure if there is any need for the eyedropper, similarly to Ryan's report about product assignment.
T
by theoryshaw on 21 Sep 2023
#
Was it intended?
Nope!...just lack of programming skills. :)
https://github.com/IfcOpenShell/IfcOpenShell/commit/6536f7b56b72879a5d3c4ea26d416014c7713e62
when you add object to an assembly with eyedropper, perhaps it should be possible to select assembly child object and it would deduce actual IfcElementAssembly from that child. And not sure if there is any need for the eyedropper, similarly to Ryan's report about product assignment.
Love the idea.
B
by bruno_perdigao on 22 Sep 2023
#
@theoryshaw said:
Sorry for the onslaught of feature requests. Just using the 'duplicate aggregate' a lot lately so just want to write them down somewhere. :)
Keep it coming! I'll try my best to keep up.
The following scenario doesn't seem to refresh.
Am I missing something, or is this just not possible currently.
What I meant earlier is that the organization of parents and children is different from what you showed (or maybe I didn't understand correctly). What mean is shown in the image below. The refresh won't work if the assembly selected is a parent. So, in this case, it would work, for example, if you change parent B and refresh the child B. Maybe you are trying to refresh parent B because you expected it to be a child of A, is that right? If so, maybe the problem happened when you were duplicating them. Makes sense?
To get this, I checked the ID in the pset BBIM_Aggregate_Data. There has to be a better way to know which is the parent is which is the child, it's on my todo list to build this functionality

B
by bruno_perdigao on 22 Sep 2023
#
I saw this UI for "representation utilities" with this warning for advanced users, and I thought maybe we could have a subpanel under aggregates, called "duplicate aggregates", with the same warning. It would allow me to start testing a UI for it. Maybe it's too soon for this, since it is highly experimental, I don't know. What you guys think?

T
by theoryshaw on 22 Sep 2023
#
I've attached another file, to hopefully better explain.

T
by theoryshaw on 22 Sep 2023
#
What you guys think?
I like it! :)
All open source development is experimental. ;)
T
by theoryshaw on 23 Sep 2023
#
When you Shift+Ctrl+D an aggregate it will attach a BBIM_Aggregate_Data
Pset to the objects inside both the parent aggregate and child aggregate.
If, however, you add an object to the parent aggregate after its initial creation, this new object does not have a BBIM_Aggregate_Data
Pset. I assume that it should, correct?
video:
T
by theoryshaw on 23 Sep 2023, edited 23 Sep 2023
#
I'm not sure how it happened, but if I refresh the following child, from this file, it makes the child disappear, and oddly highlights a few random objects in the parent, as you can see from the screenshot below.


T
by theoryshaw on 23 Sep 2023
#
... could it be because some of the objects don't have BBIM_Aggregate_Data
Pset, as mentioned above?
T
by theoryshaw on 23 Sep 2023
#
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.
...or does it make sense, on import(open) to assure that the parent is always named IfcElementAssembly/Assembly
and the children are IfcElementAssembly/Assembly.001
, IfcElementAssembly/Assembly.002
, etc.
B
by bruno_perdigao on 26 Sep 2023
#
If, however, you add an object to the parent aggregate after its initial creation, this new object does not have a BBIM_Aggregate_Data
@theoryshaw Could you test this before I submit to pull request? It should fix this problem. Hopefully, all the other problems were caused by this
T
by theoryshaw on 26 Sep 2023, edited 26 Sep 2023
#
Would it be relatively easy to process multiple children at a time?
Reason being, processing each house module for this pocket neighborhood takes a lot of time, for just one refresh. If I could select multiple children modules and run the refresh on them, I could have it run over lunch, for example, and the entire model would be updated.
T
by theoryshaw on 26 Sep 2023, edited 26 Sep 2023
#
Might have spoke too soon. (might be a different problem though)
I recreated the following parent from scratch (after your fix), and then created the following child and rotated it 90 degrees.
If I refresh the child, it disappears.
file, here.

B
by bruno_perdigao on 26 Sep 2023
#
@theoryshaw said:
Would it be relatively easy to process multiple children at a time?
Reason being, processing each house module for this pocket neighborhood takes a lot of time, for just one refresh. If I could select multiple children modules and run the refresh on them, I could have it run over lunch, for example, and the entire model would be updated.
The reason I only allowed to refresh each child at a time was to prevent the user to start a very time-consuming process without knowing, but since you are aware of this, I can change the code to allow this behavior.
I recreated the following parent from scratch (after your fix), and then created the following child and rotated it 90 degrees.
If I refresh the child, it disappears.
I'll take a look
B
by bruno_perdigao on 26 Sep 2023
#
+1 votes
@theoryshaw For now, try using this script. Make sure to select only one object from each aggregate:
objs = bpy.context.selected_objects
for obj in objs:
for s in bpy.context.selected_objects:
s.select_set(False)
obj.select_set(True)
bpy.ops.bim.refresh_aggregate()
T
by theoryshaw on 26 Sep 2023, edited 26 Sep 2023
#
See this file, as a more simplified parent/child relationship.
If you try to refresh any of the children, they disappear w/ following error.

Python: Traceback (most recent call last):
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\module\geometry\operator.py", line 1167, in execute
IfcStore.execute_ifc_operator(self, context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\ifc.py", line 336, in execute_ifc_operator
result = getattr(operator, "_execute")(context)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\module\geometry\operator.py", line 1347, in _execute
duplicate_children(parent)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\module\geometry\operator.py", line 1264, in duplicate_children
new_part = duplicate_objects(part_obj)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\bim\module\geometry\operator.py", line 1289, in duplicate_objects
new_entity = blenderbim.core.root.copy_class(
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\core\root.py", line 34, in copy_class
root.link_object_data(ifc.get_object(relating_type), obj)
File "C:\Users\Owner\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderbim\tool\root.py", line 135, in link_object_data
destination_obj.data = source_obj.data
AttributeError: 'NoneType' object has no attribute 'data'
T
by theoryshaw on 4 Oct 2023
#
-1 votes
This is an odd one. I had, for the last couple days kept these blender/ifc files in sync.
If you open the blender file, and try to shift+ctrl+d
one of the parent modules, you can see the child aggregate is missing objects.
The strange thing, however, is when you open the IFC file anew, shift+ctrl+d
works.

B
by bruno_perdigao on 6 Oct 2023, edited 7 Oct 2023
#
+1 votes
@theoryshaw I'll take a look
B
by bruno_perdigao on 7 Oct 2023
#
+1 votes
@theoryshaw The bug is a problem in your blend file. Don't know why, but the "Super King bed" type is missing and that's causing the error, which will also happen with normal shift+d
. The type exists in ifc, but not as blender object. I don't know how to recreate it. I saw the script to resync the files, but it seems that it doesn't handle this problem. Just for you know, the Ifc entity for the type is #1073758=IfcFurnitureType('0k0UHYuCPDiBqscGw44wcu',$,'Super King bed',$,$,$,(#1073742),$,$,.NOTDEFINED.,.NOTDEFINED.)
T
by theoryshaw on 11 Oct 2023, edited 11 Oct 2023
#
+1 votes
Thanks. I was able to just use a earlier version and bypass this bug. I think these bugs happen when i add/delete representation contexts to an object. I've noticed other stuff that disappears in the past, as well. Still haven't found a consistent way to replicate it though.
T
by theoryshaw on 12 Oct 2023
#
@bruno_perdigao, Relative to this concept...

...here's a real world scenario, that would have been easier to pull off, if this functionality existed...

B
by bruno_perdigao on 13 Oct 2023
#
I'll try to work on that. This could be somewhat achieved using this strict workflow, you would have to keep all the parents isolated and just nest the aggregates that are children. Not ideal yet: https://ln5.sync.com/dl/a59263e20/xtijs5kp-xyn6q7ha-2c39ewc6-5vhdi42i
T
by theoryshaw on 20 Oct 2023, edited 20 Oct 2023
#
+1 votes
Just another thought. It might be a good idea that if an object inside an aggregate is duplicated (shift+d), that it removes the `BBIM_Aggregate_Data' pset. Similar to how the 'BBIM_Array' pset is removed when an object from an array is duplicated (shift+d).
T
by theoryshaw on 20 Oct 2023
#
When there so many aggregates around, it's easy to forget where the parent is. :)
Would be nice if there was an easy way to 'find' the parent, from selecting an object in the child aggregate.
