Fix #3272. See #3069. Fix incorrect refactoring when I was decoupling collections.

This commit is contained in:
Dion Moult
2023-06-07 22:13:30 +10:00
parent 5a3a387b8c
commit 77c2e30733
+8 -2
View File
@@ -175,12 +175,18 @@ class Collector(blenderbim.core.tool.Collector):
axes = "WAxes"
grid_obj = tool.Ifc.get_object(grid)
if grid_obj:
return bpy.data.collections.get(grid_obj.name)
return grid_obj.BIMObjectProperties.collection
if element.is_a("IfcAnnotation"):
if element.ObjectType == "DRAWING":
return cls._create_project_child_collection("Views")
for rel in element.HasAssignments or []:
if rel.is_a("IfcRelAssignsToGroup") and rel.RelatingGroup.ObjectType == "DRAWING":
return cls._create_project_child_collection("Views")
for related_object in rel.RelatedObjects:
if related_object.is_a("IfcAnnotation") and related_object.ObjectType == "DRAWING":
drawing_obj = tool.Ifc.get_object(related_object)
if drawing_obj:
return drawing_obj.BIMObjectProperties.collection
if element.is_a("IfcStructuralItem"):
return cls._create_project_child_collection("StructuralItems")