
User Variables 5-29
5-29
Now, whenever both inlet and outlet streams are connected to
any pump in the case, and no energy stream is currently
connected to that pump, a new energy stream is automatically
created and connected to that pump.
For the pump and streams shown on the left of the figure below,
once the inlet and outlet streams are connected, the stream
PUMP_W is automatically created, as shown to the right:
'Late binding of Streams collection and Stream object.
Dim strs As Object
Dim newstr As Object
Set strs = ActiveCase.Flowsheet.MaterialStreams
Dim strName As String
strName = Pump.name + "_W"
Set newstr = strs.Add(strName)
newstr.IsEnergyStream = True
Pump.EnergyStream = newstr
thisvar.Value = HasRun
Else
thisvar.Value = HasRun
End If
Exit Sub
AlreadyAdded:
Exit Sub
UnknownError:
End Sub
Macro Code
Figure 5.27
Comentários a estes Manuais