mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-24 17:20:04 +00:00
Fix #2988. Imperial dimensions in viewport are now split between feet and inches.
This commit is contained in:
@@ -29,9 +29,9 @@ def refresh():
|
|||||||
SheetsData.is_loaded = False
|
SheetsData.is_loaded = False
|
||||||
SchedulesData.is_loaded = False
|
SchedulesData.is_loaded = False
|
||||||
DrawingsData.is_loaded = False
|
DrawingsData.is_loaded = False
|
||||||
|
AnnotationData.is_loaded = False
|
||||||
DecoratorData.data = {}
|
DecoratorData.data = {}
|
||||||
DecoratorData.cut_cache = {}
|
DecoratorData.cut_cache = {}
|
||||||
AnnotationData.is_loaded = False
|
|
||||||
|
|
||||||
|
|
||||||
class ProductAssignmentsData:
|
class ProductAssignmentsData:
|
||||||
|
|||||||
@@ -407,21 +407,13 @@ class BaseDecorator:
|
|||||||
blf.disable(font_id, blf.ROTATION)
|
blf.disable(font_id, blf.ROTATION)
|
||||||
|
|
||||||
def format_value(self, context, value):
|
def format_value(self, context, value):
|
||||||
unit_system = context.scene.unit_settings.system
|
return bpy.utils.units.to_string(
|
||||||
if unit_system == "IMPERIAL":
|
context.scene.unit_settings.system,
|
||||||
precision = context.scene.BIMProperties.imperial_precision
|
"LENGTH",
|
||||||
if precision == "NONE":
|
value,
|
||||||
precision = 256
|
precision=4,
|
||||||
elif precision == "1":
|
split_unit=context.scene.unit_settings.system == "IMPERIAL",
|
||||||
precision = 1
|
)
|
||||||
elif "/" in precision:
|
|
||||||
precision = int(precision.split("/")[1])
|
|
||||||
elif unit_system == "METRIC":
|
|
||||||
precision = 4
|
|
||||||
else:
|
|
||||||
return
|
|
||||||
|
|
||||||
return bpy.utils.units.to_string(unit_system, "LENGTH", value, precision=precision)
|
|
||||||
|
|
||||||
|
|
||||||
class DimensionDecorator(BaseDecorator):
|
class DimensionDecorator(BaseDecorator):
|
||||||
|
|||||||
Reference in New Issue
Block a user