Fix #4867. Accommmodate invalid IFC data from 12D.

This commit is contained in:
Dion Moult
2024-06-14 09:18:14 +10:00
parent 99338187de
commit 3a4bdd623d
2 changed files with 4 additions and 0 deletions
@@ -526,6 +526,8 @@ class IfcImporter:
if representation_id is None:
representation_id = rep.id()
rep = rep.Items[0].MappingSource.MappedRepresentation
if not rep: # Accommodate invalid files
return False
else:
if representation_id is None:
representation_id = rep.id()
@@ -255,6 +255,8 @@ class Spatial(blenderbim.core.tool.Spatial):
@classmethod
def import_spatial_element(cls, element, level_index):
if not element.is_a("IfcProject") and not tool.Root.is_spatial_element(element):
return
props = bpy.context.scene.BIMSpatialDecompositionProperties
new = props.containers.add()
new.ifc_class = element.is_a()