Specifications

Automation 2-45
2-45
Operations
All operations have a few properties and methods in common.
Operation objects contain properties for determining the feeds,
products, and additional objects connected to the operation. The
operation objects also contain methods for adding and removing
the operations from the flowsheet and the HYSYS case.
The Operations collection object obtained from the flowsheet
returns a collection of all the operations on that flowsheet. It is
possible to filter the collection of operations returned by
specifying the operation type. It is important to note however
that the operations object always returns a collection and not an
individual operation. The objects in the collection need to be
checked in order to find a specific type of operation.
The example below, enumerates through all the operations on
the flowsheet and displays the unit type in a property view.
Syntax for accessing operations
Getting all the operations on the flowsheet
SimulationCase.Flowsheet.Operations
Getting a specific collection of operations
SimulationCase.Flowsheet.Operations(“PumpOp”)
Getting to a specific operation by name
SimulationCase.Flowsheet.Operations.Item(“UnitName”)
Determining the type of operation
SimulationCase.Flowsheet.Operations.Item(0).TaggedName
Example: Operation
Dim i As Integer
Dim hyOperations As Operations
Set hyOperations = hyCase.Flowsheet.Operations
For i = 0 To hyOperations.Count - 1
MsgBox “Operation “ & hyOperations.Item(i).name & “
is unit type - & hyOperations.Item(i).TypeName
Next i