mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-25 09:02:29 +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)
|
self.remove_collection(bpy.context.scene.collection, spatial_collection)
|
||||||
for collection in bpy.data.collections:
|
for collection in bpy.data.collections:
|
||||||
if collection == relating_collection:
|
if collection == relating_collection:
|
||||||
collection.children.link(spatial_collection)
|
if not collection.children.get(spatial_collection.name):
|
||||||
|
collection.children.link(spatial_collection)
|
||||||
continue
|
continue
|
||||||
self.remove_collection(collection, spatial_collection)
|
self.remove_collection(collection, spatial_collection)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ class AssignClass(bpy.types.Operator):
|
|||||||
collection.objects.link(obj)
|
collection.objects.link(obj)
|
||||||
if parent_collection:
|
if parent_collection:
|
||||||
parent_collection.children.link(collection)
|
parent_collection.children.link(collection)
|
||||||
|
bpy.ops.bim.assign_object(related_object=obj.name, relating_object=parent_collection.name)
|
||||||
else:
|
else:
|
||||||
bpy.context.scene.collection.children.link(collection)
|
bpy.context.scene.collection.children.link(collection)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user