From 67f4ed00d0f895e4b57125146de971b9b073dc54 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 8 May 2024 12:53:30 +0500 Subject: [PATCH] fix couple silent bugs importing containers 1) we were setting OwnerHistory to the "elevation" attribute of SpatialElement (in BIMSpatialProperties.containers) 2) we were setting "elevation" attribute at all when SpatialElement doesn't have "elevation" attribute Though those bugs were silent since PropertyGroup doesn't alarm when we add a completely new attribute to it. --- src/blenderbim/blenderbim/tool/spatial.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/blenderbim/blenderbim/tool/spatial.py b/src/blenderbim/blenderbim/tool/spatial.py index 94fde8ab6e..ffb886ce78 100644 --- a/src/blenderbim/blenderbim/tool/spatial.py +++ b/src/blenderbim/blenderbim/tool/spatial.py @@ -113,14 +113,12 @@ class Spatial(blenderbim.core.tool.Spatial): for element in rel.RelatedObjects: related_objects.append((element, ifcopenshell.util.placement.get_storey_elevation(element))) related_objects = sorted(related_objects, key=lambda e: e[1]) - for element in related_objects: - element = element[0] + for element, _ in related_objects: new = props.containers.add() new.name = element.Name or "Unnamed" new.long_name = element.LongName or "" new.has_decomposition = bool(element.IsDecomposedBy) new.ifc_definition_id = element.id() - new.elevation = element[1] @classmethod def run_root_copy_class(cls, obj=None):