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.
This commit is contained in:
Andrej730
2024-05-08 12:53:30 +05:00
parent 10d30b0de7
commit 67f4ed00d0
+1 -3
View File
@@ -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):