mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Spatial aggregations are auto assigned when you create them. Neat.
This commit is contained in:
@@ -39,7 +39,8 @@ class AssignObject(bpy.types.Operator):
|
||||
self.remove_collection(bpy.context.scene.collection, spatial_collection)
|
||||
for collection in bpy.data.collections:
|
||||
if collection == relating_collection:
|
||||
collection.children.link(spatial_collection)
|
||||
if not collection.children.get(spatial_collection.name):
|
||||
collection.children.link(spatial_collection)
|
||||
continue
|
||||
self.remove_collection(collection, spatial_collection)
|
||||
else:
|
||||
|
||||
@@ -153,6 +153,7 @@ class AssignClass(bpy.types.Operator):
|
||||
collection.objects.link(obj)
|
||||
if parent_collection:
|
||||
parent_collection.children.link(collection)
|
||||
bpy.ops.bim.assign_object(related_object=obj.name, relating_object=parent_collection.name)
|
||||
else:
|
||||
bpy.context.scene.collection.children.link(collection)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user