mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
See #4826. If a Qto calculator returns none, don't fail
There can be valid reasons for this, such as if the calculator realises it cannot compute a value (e.g. no mass density when calculating weight)
This commit is contained in:
@@ -265,9 +265,10 @@ class Blender:
|
||||
continue
|
||||
if not (formula_function := formula_functions.get(formula)):
|
||||
formula_function = formula_functions[formula] = getattr(calculator, formula)
|
||||
results[element][name][quantity] = unit_converter.convert(
|
||||
formula_function(obj), Blender.functions[formula].measure
|
||||
)
|
||||
if (value := formula_function(obj)) is not None:
|
||||
results[element][name][quantity] = unit_converter.convert(
|
||||
value, Blender.functions[formula].measure
|
||||
)
|
||||
|
||||
|
||||
calculators = {"Blender": Blender, "IfcOpenShell": IfcOpenShell}
|
||||
|
||||
Reference in New Issue
Block a user