mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 10:57:49 +00:00
Don't break if no area unit defined
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user