Don't break if no area unit defined

This commit is contained in:
Dion Moult
2025-02-26 13:13:22 +11:00
parent 0104a2cc9f
commit 0f3de599a6
@@ -137,9 +137,10 @@ def format_distance(
scaleFactor = bpy.context.scene.unit_settings.scale_length
unit_system = bpy.context.scene.unit_settings.system
unit_length = bpy.context.scene.unit_settings.length_unit
area_unit_symbol = " " + ifcopenshell.util.unit.get_unit_symbol(
ifcopenshell.util.unit.get_project_unit(tool.Ifc.get(), "AREAUNIT")
)
if area_unit := ifcopenshell.util.unit.get_project_unit(tool.Ifc.get(), "AREAUNIT"):
area_unit_symbol = " " + ifcopenshell.util.unit.get_unit_symbol(area_unit)
else:
area_unit_symbol = ""
value *= scaleFactor