Z-coordinate in PlanLevelDecorator relative to spatial container if exists. Absolute otherwise (#6845)

* Z-coordinate  in PlanLevelDecorator relative to spatial container if exists. Absolute otherwise
This commit is contained in:
falken10vdl
2025-06-27 15:20:50 +02:00
committed by GitHub
parent fef6ef76ed
commit 0b05c3bcfc
@@ -1204,7 +1204,19 @@ class PlanLevelDecorator(BaseDecorator):
text_dir *= -1
def get_text():
z = verts[0].z
abs_z = verts[0].z
z = abs_z
if element:
spatial_container = ifcopenshell.util.element.get_container(element)
if spatial_container:
container_obj = tool.Ifc.get_object(spatial_container)
if container_obj:
spatial_container_z = container_obj.matrix_world.translation.z
z = abs_z - spatial_container_z
rl = self.format_value(context, z)
text = "{}{}".format("" if z < 0 else "+", rl)
return text