Specifications
Extensibility 3-57
3-57
4. Rename the project name to UnitOpExtn as shown.
5. Save the class and project by selecting Save Project
command from the File menu. Save the class and project as
Saturate.cls and Saturate.vbp.
6. Begin by defining the global variables in the Project Code
Editor:
Figure 3.26
Code Explanation
Option Explicit
Used to force explicit declaration of all variables in
that module.
Declare the global HYSYS objects. The hy prefix is
a convention to identify variables which come from
HYSYS.
Dim hyContainer As
ExtnUnitOperationContainer
• The extension unit operation container
object.
Dim hyFeedStrm As Object
• The extension feed stream object.
Dim hyProdStrm As Object
• The extension product stream object.
Dim hyWatStrm As Object
• The extension water stream object.
Declare objects used internally:
Dim Components As Object
• The HYSYS Components collection object.
Dim Component As Object
• A single HYSYS Component object.
Dim WorkFluid As Object
• A fluid object used for calculations.
Dim WatFluid As Object
• A water fluid object.
Dim Streams(0 To 2) As Object
• An array of ProcessStream objects.
Dim myOp As Object
• Object reference to the Extension Interface.
Declare variables used internally:
Dim WaterPresent As Boolean
• Indicates if water is present.