Can we access Chemsep Column variables through python scripting? I was exploring in DWSIM namespaces for Chemsep column class like Distillation Column class in DWSIM but could not find any.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This method is working for reading the variables but when I am trying to use SetPropertyValue (for example: rd.SetPropertyValue("Number of stages" , 20)) it throws "TypeError: Specified cast not valid". I have tried various datatypes including system Int32, Int64 but it still shows the same error.
Last edit: Pravin Dalve 2023-04-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I accidently gave "Number of stages" and "Feed stages" as Double and it worked. Shouldn't those variables be Integers?
Also how can we access reaction variables like "Start stage" and "End stage"? These are not present in the dropdown menu of variables section in above window. Please explain both Get and Set methods.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Handling of variables is done by the unit operation itself. If the parameter is defined as CAPE_REAL, then it will only accept double-precision values.
If the variables that you want are not exposed by ChemSep then I can't do much, sorry. You would have to contact the developers and ask for them to be included in a future update.
Regards
Daniel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can we access Chemsep Column variables through python scripting? I was exploring in DWSIM namespaces for Chemsep column class like Distillation Column class in DWSIM but could not find any.
First you need to expose the properties that you want through the column editor:
Then, access the variable values in python with
This method is working for reading the variables but when I am trying to use SetPropertyValue (for example: rd.SetPropertyValue("Number of stages" , 20)) it throws "TypeError: Specified cast not valid". I have tried various datatypes including system Int32, Int64 but it still shows the same error.
Last edit: Pravin Dalve 2023-04-13
Hi Daniel,
I accidently gave "Number of stages" and "Feed stages" as Double and it worked. Shouldn't those variables be Integers?
Also how can we access reaction variables like "Start stage" and "End stage"? These are not present in the dropdown menu of variables section in above window. Please explain both Get and Set methods.
Hi Pravin,
Handling of variables is done by the unit operation itself. If the parameter is defined as CAPE_REAL, then it will only accept double-precision values.
If the variables that you want are not exposed by ChemSep then I can't do much, sorry. You would have to contact the developers and ask for them to be included in a future update.
Regards
Daniel