Fix error loading IFC file without contexts #7060 (8d3aa98)

This commit is contained in:
Andrej730
2025-08-28 11:09:28 +05:00
parent 43fbdf57c8
commit 71a6bf25bc
+2 -2
View File
@@ -203,8 +203,8 @@ class Unit(bonsai.core.tool.Unit):
@classmethod
def format_value(cls, value: float) -> str:
precision = tool.Ifc.get().by_type("IfcGeometricRepresentationContext")[0].Precision
if precision:
context = next(iter(tool.Ifc.get().by_type("IfcGeometricRepresentationContext")), None)
if context and (precision := context.Precision):
decimal_places = math.ceil(math.log10(1 / precision))
else:
precision = 1e-5