Fixed errors after b6ddc0d

`element.is_a() in ...` wasn't taking into account spatial classes that inherit from IfcSpatialElement/IfcSpatialStructureElement
This commit is contained in:
Andrej730
2023-07-22 10:36:40 +05:00
parent 0c97e56791
commit 13a5317863
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ class Geometry(blenderbim.core.tool.Geometry):
if element.VoidsElements:
bpy.ops.bim.remove_opening(opening_id=element.id())
else:
is_spatial = element.is_a() in ("IfcSpatialElement", "IfcSpatialStructureElement")
is_spatial = element.is_a("IfcSpatialElement") or element.is_a("IfcSpatialStructureElement")
if getattr(element, "HasOpenings", None):
for rel in element.HasOpenings:
bpy.ops.bim.remove_opening(opening_id=rel.RelatedOpeningElement.id())
+3 -3
View File
@@ -52,7 +52,7 @@ class Spatial(blenderbim.core.tool.Spatial):
if not structure.is_a("IfcSpatialStructureElement"):
return False
else:
if not structure.is_a() in ("IfcSpatialElement", "IfcSpatialStructureElement"):
if not structure.is_a("IfcSpatialElement"):
return False
if not hasattr(element, "ReferencedInStructures"):
return False
@@ -204,7 +204,7 @@ class Spatial(blenderbim.core.tool.Spatial):
parent = tool.Ifc.get().by_type("IfcProject")[0]
for object in ifcopenshell.util.element.get_parts(parent) or []:
if object.is_a() in ("IfcSpatialElement", "IfcSpatialStructureElement"):
if object.is_a("IfcSpatialElement") or object.is_a("IfcSpatialStructureElement"):
cls.create_new_storey_li(object, 0)
cls.props.is_container_update_enabled = True
@@ -223,7 +223,7 @@ class Spatial(blenderbim.core.tool.Spatial):
new.has_children = True
if new.is_expanded:
for related_object in ifcopenshell.util.element.get_parts(element) or []:
if related_object.is_a() in ("IfcSpatialElement", "IfcSpatialStructureElement"):
if related_object.is_a("IfcSpatialElement") or related_object.is_a("IfcSpatialStructureElement"):
cls.create_new_storey_li(related_object, level_index + 1)
@classmethod