mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-16 18:44:47 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user