
Customization FAQ A-29
A-29
16. How do I automatically set the Calc Level (calculation level)
of an extension?
Ans: Add the following to the Initialize function of the
extension code:
17. How do I automatically attach an existing stream to a Unit
Operation Extension when it is added to the PFD?
Ans: In the Initialize function of the extension, make an
object reference to the stream which will be attached to the
extension. Then use FindVariable to set the name of the
stream defined in the EDF equal to the stream object
reference.
The following code demonstrates this:
18. What is a “Forget” Pass?
Ans: HYSYS unit operations can calculate “product” variables
based on “feed” variables, “feed” variables based on
“product” variables, or a combination of the two. This can
lead to very complicated interdependency between the
variables in a flowsheet. When a variable is changed, HYSYS
must first “forget” all of the variables that were calculated
based on the original value, and then re-calculate based on
the new value. If the values are not forgotten, an attempt to
calculate a new value is misinterpreted by HYSYS as an
inconsistency.
Set hyContainer = Container
Set hyInterface = hyContainer.ExtensionInterface
hyInterface.CalcLevel = 1000
where:
Both hyContainer and hyInterface are declared as Objects
Dim hyFeed As Object
Set hyFeed = hyContainer.Flowsheet.MaterialStreams("Feed")
hyContainer.FindVariable("Feed").Variable.Object = hyFeed
Comentários a estes Manuais