mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-28 03:05:33 +00:00
Fixed bug with saving data to Pset_StairFlightCommon not in project units
This commit is contained in:
@@ -254,11 +254,16 @@ def update_ifc_stair_props(obj):
|
|||||||
number_of_risers = props.number_of_treads + 1
|
number_of_risers = props.number_of_treads + 1
|
||||||
# update IfcStairFlight properties (seems already deprecated but keep it for now)
|
# update IfcStairFlight properties (seems already deprecated but keep it for now)
|
||||||
# http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcStairFlight.htm
|
# 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"):
|
if element.is_a("IfcStairFlight"):
|
||||||
element.NumberOfRisers = number_of_risers
|
element.NumberOfRisers = number_of_risers
|
||||||
element.NumberOfTreads = props.number_of_treads
|
element.NumberOfTreads = props.number_of_treads
|
||||||
element.RiserHeight = props.height / number_of_risers
|
element.RiserHeight = riser_height
|
||||||
element.TreadLength = props.tread_depth
|
element.TreadLength = tread_length
|
||||||
|
|
||||||
# update pset with ifc properties
|
# update pset with ifc properties
|
||||||
pset_common = tool.Pset.get_element_pset(element, "Pset_StairFlightCommon")
|
pset_common = tool.Pset.get_element_pset(element, "Pset_StairFlightCommon")
|
||||||
@@ -272,8 +277,8 @@ def update_ifc_stair_props(obj):
|
|||||||
properties={
|
properties={
|
||||||
"NumberOfRiser": number_of_risers,
|
"NumberOfRiser": number_of_risers,
|
||||||
"NumberOfTreads": props.number_of_treads,
|
"NumberOfTreads": props.number_of_treads,
|
||||||
"RiserHeight": props.height / number_of_risers,
|
"RiserHeight": riser_height,
|
||||||
"TreadLength": props.tread_depth,
|
"TreadLength": tread_length,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
tool.Ifc.edit(obj)
|
tool.Ifc.edit(obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user