Functions for Process (Flowsheet) Variables

The following functions can be used for setting or retrieving variables that refer to the specific processs file. These include economic, scheduling, component, and material variables that affect the simulation case.

These functions can be used to retrieve the value of input/output variables related to the whole process (flowsheet), and not associated to particular object in the process file:

GetFlowsheetVarVal(VarID As VarID, val)

GetFlowsheetVarVal2(VarID As VarID, val, val2)

GetFlowsheetVarVal3(VarID As VarID, val, val2, val3)


These functions can be used for seetting input variables related to the specific process file:

SetFlowsheetVarVal(VarID As VarID, val)

SetFlowsheetVarVal2(VarID As VarID, val, val2)

SetFlowsheetVarVal3(VarID As VarID, val, val2, val3)

 

The first argument (varID) is the variable identifier that specifies the variable we want to access and the second argument (val) is the variable’s value. The third/fourth arguments (val2 / val3), also of VARIANT type, are extra identifiers needed for the variable we want to access in the functions with three /four arguments. The Variable ID that needs to be used for each variable is listed in Flowsheet Variables. Please, see Accessing Pro-Designer Variables with COM for general information on accessing the Pro-Designer variables with the COM Server.

For a sample script that illustrates the use of these functions, see Scripts for Flowsheet variables.

Rename Functions

The following functions can be used to rename objects used in the process:

      RenameProcedure(oldName As String, newName As String)

      RenameOperation(procedureName As String, oldName As String, newName As String)

      RenameStream(oldName As String, newName As String)

      RenameEquipment(oldName As String, newName As String)

      RenameAuxEquipment(oldName As String, newName As String)

In all the above functions you must provide the name of the object (procedure, operation, stream, main equipment or auxiliary equipment) you wish to rename and the new name of the object. Especially for renaming an operation you must also provide the procedure name hosting it.

Replace Resource Functions

The following functions can be used to replace resources in the process with resources that exist in the SuperPro database:

      ReplaceHXAgent(oldResource As String, newResource As String)

      ReplaceHXAgentInSection(branchName As String, sectionName As String, oldResource As String, newResource As String)

      ReplaceHXAgentInOperation(procedureName As String, operationName, oldResource As String, newResource As String)

      ReplacePower(oldResource As String, newResource As String)

      ReplacePowerInSection(branchName As String, sectionName As String, oldResource As String, newResource As String)

      ReplacePowerInOperation(procedureName As String, operationName, oldResource As String, newResource As String)

      ReplaceLabor(oldResource As String, newResource As String)

      ReplaceLaborInSection(branchName As String, sectionName As String, oldResource As String, oldService As String, newResource As String, newService As String)

      ReplaceLaborInOperation(procedureName As String, operationName, oldResource As String, oldService As String, newResource As String, newService As String)

      ReplaceConsumable(typeName As String, oldResource As String, newResource As String)

      ReplaceConsumableInEquipment(equipName As String, typeName As String, oldResource As String, newResource As String)

      ReplaceConsumableInAuxEquipment(equipName As String, typeName As String, oldResource As String, newResource As String)

In order to replace the labor resource in a section or an operation, one must provide a valid service name even if the intention is not to change the service name.

In the case of replacing consumables you must provide the consumable category type name. The category name can be found on the All Consumable Categories (left tree) in the Consumables Databank dialogue which can be viewed by selecting Databanks } Consumables... from the main menu.

IconInfo00004.bmp 

Please note that for any kind of resource replacement to occur the new resource must exist in the SuperPro database. If the resource cannot be found in the database the above functions will simply return FALSE.