
A-4 Automation FAQ
A-4
For example, if hyMix refers to a Mixer unit operation object
and hyFeed1 and hyFeed2 refer to material stream objects,
the following syntax would add the material streams as
feeds to the mixer.
The same is true for the Products property of unit operations
which can have multiple products. For example,
The following code is a HYSYS macro which demonstrates
the above.
hyMix.Feeds.Add hyFeed1
hyMix.Feeds.Add hyFeed2
hyMix.Products.Add hyProduct1
hyMix.Products.Add hyProduct2
Sub Main
' This macro assume an active sheet which has the following
Streams: Feed1, Feed2, Product
Set hyCase = ActiveCase
Set hyFS = hyCase.Flowsheet
Set hyOpers = hyFS.Operations
Set hyFeed1 = hyFS.MaterialStreams("Feed1")
Set hyFeed2 = hyFS.MaterialStreams("Feed2")
Set hyProduct = hyFS.MaterialStreams("Product")
' Add a Mixer named Mix-100
hyOpers.Add ("Mix-100", "MixerOp")
' Set an Object reference To the Mixer
Set hyMix = hyOpers.Item("Mix-100")
' **Add feed Streams To the Mix-100 (must be added one at a
Time, can’t use an Array of Streams)
hyMix.Feeds.Add hyFeed1
hyMix.Feeds.Add hyFeed2
hyMix.Product = hyProduct
End Sub
Komentáře k této Příručce