mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 21:59:59 +00:00
Fix #4867. Accommmodate invalid IFC data from 12D.
This commit is contained in:
@@ -526,6 +526,8 @@ class IfcImporter:
|
|||||||
if representation_id is None:
|
if representation_id is None:
|
||||||
representation_id = rep.id()
|
representation_id = rep.id()
|
||||||
rep = rep.Items[0].MappingSource.MappedRepresentation
|
rep = rep.Items[0].MappingSource.MappedRepresentation
|
||||||
|
if not rep: # Accommodate invalid files
|
||||||
|
return False
|
||||||
else:
|
else:
|
||||||
if representation_id is None:
|
if representation_id is None:
|
||||||
representation_id = rep.id()
|
representation_id = rep.id()
|
||||||
|
|||||||
@@ -255,6 +255,8 @@ class Spatial(blenderbim.core.tool.Spatial):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def import_spatial_element(cls, element, level_index):
|
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
|
props = bpy.context.scene.BIMSpatialDecompositionProperties
|
||||||
new = props.containers.add()
|
new = props.containers.add()
|
||||||
new.ifc_class = element.is_a()
|
new.ifc_class = element.is_a()
|
||||||
|
|||||||
Reference in New Issue
Block a user