I have a question about the Script Manager. I would like to access the script manager in DWSIM via python and add my own kinetics.
The User-Guide only explains how to use script manager in DWSIM but my question is, how to access the Script Manager via Python and switch from 'simple' to 'advanced' reaction specification, without opening the software.
Thanks a lot!!!
Last edit: Ella Daiki 2023-03-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
KeyNotFoundException: The specified key was not given in the dictionary. bei System.ThrowHelper.ThrowKeyNotFoundException(). bei System.Collections.Generic.Dictionary'2.get_Item(TKey key)
But 'myscripttitle' appears as saved in the Variable Explorer of Python.
Regards.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
File [...] in <module> myreaction.ReactionKinetics = 1 # script TypeError: since Python.NET 3.0 int can not be converted to Enum implicitly. Use Enum(intvalue)</module>
Is there perhaps a module missing?
(running python version 3.9.13, if it matters)
Thanks again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I found a post saying that an update of python can solve the problem. So I executed the code once with 3.9 and 3.10, but I still get the same Error: TypeError: since Python.NET 3.0 int can not be converted to Enum implicitly. Use Enum(intvalue)
Is there any other way to execute a Script from Script Manager, using python?
Best regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey all,
I have a question about the Script Manager. I would like to access the script manager in DWSIM via python and add my own kinetics.
The User-Guide only explains how to use script manager in DWSIM but my question is, how to access the Script Manager via Python and switch from 'simple' to 'advanced' reaction specification, without opening the software.
Thanks a lot!!!
Last edit: Ella Daiki 2023-03-10
Thanks a lot.
The last Line is causing an error:
But 'myscripttitle' appears as saved in the Variable Explorer of Python.
Regards.
You must replace 'myreaction' and 'myscript' with the actual titles from your own simulation.
Thanks for the answer.
But I still have an error:
File [...] in <module> myreaction.ReactionKinetics = 1 # script
TypeError: since Python.NET 3.0 int can not be converted to Enum implicitly. Use Enum(intvalue)</module>
Is there perhaps a module missing?
(running python version 3.9.13, if it matters)
Thanks again.
Hi,
I found a post saying that an update of python can solve the problem. So I executed the code once with 3.9 and 3.10, but I still get the same Error: TypeError: since Python.NET 3.0 int can not be converted to Enum implicitly. Use Enum(intvalue)
Is there any other way to execute a Script from Script Manager, using python?
Best regards