From ecc02630627a741d699f59ebd31c054357155321 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 1 Jun 2023 09:58:29 +0500 Subject: [PATCH] Fixed bug with saving data to Pset_StairFlightCommon not in project units --- src/blenderbim/blenderbim/bim/module/model/stair.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/model/stair.py b/src/blenderbim/blenderbim/bim/module/model/stair.py index 33f85c347c..52d90348e2 100644 --- a/src/blenderbim/blenderbim/bim/module/model/stair.py +++ b/src/blenderbim/blenderbim/bim/module/model/stair.py @@ -254,11 +254,16 @@ def update_ifc_stair_props(obj): number_of_risers = props.number_of_treads + 1 # update IfcStairFlight properties (seems already deprecated but keep it for now) # http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcStairFlight.htm + + si_conversion = ifcopenshell.util.unit.calculate_unit_scale(ifc_file) + riser_height = props.height / number_of_risers / si_conversion + tread_length = props.tread_depth / si_conversion + if element.is_a("IfcStairFlight"): element.NumberOfRisers = number_of_risers element.NumberOfTreads = props.number_of_treads - element.RiserHeight = props.height / number_of_risers - element.TreadLength = props.tread_depth + element.RiserHeight = riser_height + element.TreadLength = tread_length # update pset with ifc properties pset_common = tool.Pset.get_element_pset(element, "Pset_StairFlightCommon") @@ -272,8 +277,8 @@ def update_ifc_stair_props(obj): properties={ "NumberOfRiser": number_of_risers, "NumberOfTreads": props.number_of_treads, - "RiserHeight": props.height / number_of_risers, - "TreadLength": props.tread_depth, + "RiserHeight": riser_height, + "TreadLength": tread_length, }, ) tool.Ifc.edit(obj)