wmayer wrote: ping
[Fixed]Can not set material: "Not known problem"
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
Re: Can not set material: "Not known problem"
seams we need werner ...
Re: Can not set material: "Not known problem"
Something must be wrong with the Quantity grammar file.
Here is a code snippet which can be reproduced independent of any user preferences:
Here is a code snippet which can be reproduced independent of any user preferences:
Code: Select all
from FreeCAD import Units
param_value = Units.Quantity('0.0001 m/m/K')
param_value.getValueAs("1/K") # fails
param_value.getValueAs("m/m/K") # works
param_value.getValueAs("1 1/K") # works
param_value.getValueAs("K^-1") # works
Re: Can not set material: "Not known problem"
Is it possible, that the problem is, that quantity is defined as "num unit"?
I would suspect, that the parser sees the "1" as num and "/K" as unit - even though "one / unit" is defined.
I'm no yacc pro though
I would suspect, that the parser sees the "1" as num and "/K" as unit - even though "one / unit" is defined.
I'm no yacc pro though
Re: Can not set material: "Not known problem"
I am not an expert either but the line
Code: Select all
| ONE '/' unit { $$ = Quantity(1.0)/$3; }
Code: Select all
num unit { $$ = $1*$2; }
Code: Select all
FreeCAD.Units.Unit("1 / K")
Re: Can not set material: "Not known problem"
yes, that fixed it for me! It seems to work now in other unit systems as well. Thanks a lot!