
2-50 Key HYSYS Objects
2-50
returned to variants.
The presence of Flex in the object name indicates the
possibility of a dynamic array (in other words, has a
variable size, depending on what is being returned.)
The example below, shows how to get a stream property value
in a specific unit using the RealVariable method GetValue.
The example below, shows how to set a stream property value
in a specific unit using the RealVariable method SetValue.
The example below, checks how the temperature value of a
stream is determined by examining the state property.
The constants vsCalculated, vsSpecified, and
Example 1: RealVariable
Dim hyStream As ProcessStream
Dim TemperatureVal As Double
Set hyStream = hyCase.Flowsheet.MaterialStreams.Item(0)
TemperatureVal = hyStream.Temperature.GetValue(“F”)
MsgBox hyStream.name & “ temperature(F) = “ & TemperatureVal
Example 2: RealVariable
Dim hyStream As ProcessStream
Dim TemperatureVal As Double
Set hyStream = hyCase.Flowsheet.MaterialStreams.Item(0)
TemperatureVal = 150
hyStream.Temperature.SetValue 150, “F”
Example 3: RealVariable
Dim hystream As ProcessStream
Set hystream = hyCase.Flowsheet.MaterialStreams.Item(0)
Select Case hystream.Temperature.State
Case vsCalculated
MsgBox “Temperature value is calculated.”
Case vsSpecified
MsgBox “Temperature value is specified.”
Case vsDefaultedValue
MsgBox “Temperature value is default.”
End Select
Komentáře k této Příručce