Fixed error when accessing the UnitType attribute in convert_file_length_units

This commit is contained in:
BelGraDev
2026-08-11 11:04:27 +02:00
committed by Thomas Krijnen
parent f05dd4aea5
commit 33f61ef344
@@ -962,7 +962,7 @@ def convert_file_length_units(ifc_file: ifcopenshell.file, target_units: str = "
)
unit_assignment = get_unit_assignment(file_patched)
unit_assignment.Units = [new_length, *(u for u in unit_assignment.Units if u.UnitType != new_length.UnitType)]
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)