mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +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
|
continue
|
||||||
if not (formula_function := formula_functions.get(formula)):
|
if not (formula_function := formula_functions.get(formula)):
|
||||||
formula_function = formula_functions[formula] = getattr(calculator, formula)
|
formula_function = formula_functions[formula] = getattr(calculator, formula)
|
||||||
results[element][name][quantity] = unit_converter.convert(
|
if (value := formula_function(obj)) is not None:
|
||||||
formula_function(obj), Blender.functions[formula].measure
|
results[element][name][quantity] = unit_converter.convert(
|
||||||
)
|
value, Blender.functions[formula].measure
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
calculators = {"Blender": Blender, "IfcOpenShell": IfcOpenShell}
|
calculators = {"Blender": Blender, "IfcOpenShell": IfcOpenShell}
|
||||||
|
|||||||
Reference in New Issue
Block a user