mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user