I have checked the Membrane Unit Operation model to see how to write a script in IronPython. Unfortunately, it seems that the model uses absolute naming conventions for the feed stream, and not relative. What I mean to say by this is that it references "feed" directly on the sheet, not "Input Stream 1->". The disadvantage to this is that this unit operation cannot be generalized, since it doesn't refer to its inputs directly but refers to some named objects on the sheet that may not be actually connected to it.
So how do I refer to the object which I have attached to Inlet Stream 1?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the help (F1) file you'll find a section for the Script UO where you can find the associated objects and their names:
There are up to six streams available for the UO, three as input and three as output. Supported Languages are IronPython, IronRuby, VBScript and JScript. You can use some predefined reference variables inside your script, defined as shortcuts to the most common objects:
ims1: Input Material Stream in slot 1 (MaterialStream class instance)
ims2: Input Material Stream in slot 2 (MaterialStream class instance)
ims3: Input Material Stream in slot 3 (MaterialStream class instance)
oms1: Output Material Stream in slot 1 (MaterialStream class instance)
oms2: Output Material Stream in slot 2 (MaterialStream class instance)
oms3: Output Material Stream in slot 3 (MaterialStream class instance)
Me: Reference variable to the Custom UO object instance (CustomUO UnitOperation class)
Flowsheet: Reference variable to the active flowsheet object (FormChild class)
Solver: Flowsheet solver class instance, used to send commands to the calculator (COMSolver class)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have checked the Membrane Unit Operation model to see how to write a script in IronPython. Unfortunately, it seems that the model uses absolute naming conventions for the feed stream, and not relative. What I mean to say by this is that it references "feed" directly on the sheet, not "Input Stream 1->". The disadvantage to this is that this unit operation cannot be generalized, since it doesn't refer to its inputs directly but refers to some named objects on the sheet that may not be actually connected to it.
So how do I refer to the object which I have attached to Inlet Stream 1?
Thanks!
Hi John,
In the help (F1) file you'll find a section for the Script UO where you can find the associated objects and their names:
There are up to six streams available for the UO, three as input and three as output. Supported Languages are IronPython, IronRuby, VBScript and JScript. You can use some predefined reference variables inside your script, defined as shortcuts to the most common objects:
ims1: Input Material Stream in slot 1 (MaterialStream class instance)
ims2: Input Material Stream in slot 2 (MaterialStream class instance)
ims3: Input Material Stream in slot 3 (MaterialStream class instance)
oms1: Output Material Stream in slot 1 (MaterialStream class instance)
oms2: Output Material Stream in slot 2 (MaterialStream class instance)
oms3: Output Material Stream in slot 3 (MaterialStream class instance)
Me: Reference variable to the Custom UO object instance (CustomUO UnitOperation class)
Flowsheet: Reference variable to the active flowsheet object (FormChild class)
Solver: Flowsheet solver class instance, used to send commands to the calculator (COMSolver class)
Except that it doesn't support IronRuby anymore, nor VBScript/JScript. :-)
Thank you.