Setting simulation parameters with python leads to invalid model
Hello,
I am currently trying to automate the creation of MBS models with the MotionView Python Interface.
Everything works quite good so far and I am able to define even complex models with just a python script.
However, once I try to set or access any parameter from the Model.simPara class, the model is not valid anymore and when trying to export the solver file I get the following error:
Syntax error...Math parser error evaluating run_name-value under Model-MotionSolve Simulation Options. [General]
This message appears regardless of the model and value I access or set.
Further, when setting the value it appears to set the value but also messes up some other parameter, that cannot be parsed later..
To be more precise:
- I open a model that has not been modified and it runs
- I execute on of the following commands and I get the error shown above
# this actually sets the value to 10 and leads to the error >>> model.simPara.end_time = 10 >>> model.simPara.end_time 10.0 >>> model.simPara.setValue("end_time", 5) >>> model.simPara.end_time 5.0 # accessing the parameter also leads to the error >>> model.simPara.h0_max 1e-08 >>> model.simPara.getValue("h0_max") 1e-08
Even executing the last command leads to an asterisk appearing behind the model in the project browser, which means there are unsaved changes.
The documentation gives an example how to set the parameters but that does not work.
https://2023.help.altair.com/2023/hwdesktop/hwx/topics/reference/mv/simulationparameters_python_class_simulationparameters_r.htm
Is there any other method for setting the simulation parameters with the python script?
Thanks you!
Best Regards
Tobias