mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 12:22:37 +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
|
scaleFactor = bpy.context.scene.unit_settings.scale_length
|
||||||
unit_system = bpy.context.scene.unit_settings.system
|
unit_system = bpy.context.scene.unit_settings.system
|
||||||
unit_length = bpy.context.scene.unit_settings.length_unit
|
unit_length = bpy.context.scene.unit_settings.length_unit
|
||||||
area_unit_symbol = " " + ifcopenshell.util.unit.get_unit_symbol(
|
if area_unit := ifcopenshell.util.unit.get_project_unit(tool.Ifc.get(), "AREAUNIT"):
|
||||||
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
|
value *= scaleFactor
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user