From 8dc1ee55b58f3952b7fb1ac43eccdc9df59d4c2b Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 11 Aug 2026 12:13:15 +0200 Subject: [PATCH] Apply suggestion from @aothms --- src/ifcopenshell-python/ifcopenshell/util/unit.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ifcopenshell-python/ifcopenshell/util/unit.py b/src/ifcopenshell-python/ifcopenshell/util/unit.py index 3599aab3f5..8c331712a7 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/unit.py +++ b/src/ifcopenshell-python/ifcopenshell/util/unit.py @@ -962,6 +962,7 @@ def convert_file_length_units(ifc_file: ifcopenshell.file, target_units: str = " ) unit_assignment = get_unit_assignment(file_patched) + # UnitType not available on IfcMonetaryUnit unit_assignment.Units = [new_length, *(u for u in unit_assignment.Units if getattr(u, 'UnitType', None) != new_length.UnitType)] if not file_patched.get_total_inverses(old_length): ifcopenshell.util.element.remove_deep2(file_patched, old_length)