Fix append_asset conversion issue after 3ffc0bc #6012

Custom file.add wasn't considering IfcLengthMeasure attributes...
This commit is contained in:
Andrej730
2025-01-23 12:58:28 +05:00
parent 5bc91ec4e4
commit 42d01ac222
3 changed files with 90 additions and 5 deletions
@@ -639,6 +639,7 @@ def calculate_unit_scale(ifc_file: ifcopenshell.file, unit_type: str = "LENGTHUN
:param unit_type: The type of SI unit, defaults to "LENGTHUNIT"
:returns: The scale factor
"""
# Currently we assume that all ifc projects must have IfcProject.
if not (units := ifc_file.by_type("IfcProject")[0].UnitsInContext):
return 1
unit_scale = 1