mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 23:19:57 +00:00
Handle orphaned spatial elements when loading projects
This commit is contained in:
@@ -1357,6 +1357,13 @@ class IfcImporter:
|
|||||||
def create_spatial_decomposition_collections(self):
|
def create_spatial_decomposition_collections(self):
|
||||||
for rel_aggregate in self.project["ifc"].IsDecomposedBy or []:
|
for rel_aggregate in self.project["ifc"].IsDecomposedBy or []:
|
||||||
self.create_spatial_decomposition_collection(self.project["blender"], rel_aggregate.RelatedObjects)
|
self.create_spatial_decomposition_collection(self.project["blender"], rel_aggregate.RelatedObjects)
|
||||||
|
|
||||||
|
# Invalid IFCs may have orphaned spatial structure elements.
|
||||||
|
orphaned_spaces = [e for e in self.spatial_elements if e.GlobalId not in self.collections]
|
||||||
|
while orphaned_spaces:
|
||||||
|
self.create_spatial_decomposition_collection(self.project["blender"], orphaned_spaces)
|
||||||
|
orphaned_spaces = [e for e in self.spatial_elements if e.GlobalId not in self.collections]
|
||||||
|
|
||||||
self.create_views_collection()
|
self.create_views_collection()
|
||||||
self.create_type_collection()
|
self.create_type_collection()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user