Template:Initialise PreStart Examples

From SysCAD Documentation
Jump to navigation Jump to search

Reset Actions

Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration

 ; Perform complete reset of project
 ["$Solver.Cmd.CompleteReset"] = 1  

EndSub

Activate/deactivate flowsheets

SysCAD 9.3 Build 137 or later Format
Separate variables for Activate or Deactivate
Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration

 ; Activate flowsheet 05_Flowsheet
 ["PlantModel.Page[05_Flowsheet].Activate"] = 1  

 ; Deactivate flowsheet 10_Flowsheet
 ["PlantModel.Page[10_Flowsheet].DeActivate"] = 1

EndSub
SysCAD 9.3 Build 136 Format
Same variable for Activate or Deactivate
Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration

 ; Activate flowsheet 05_Flowsheet
 ["PlantModel.Page[05_Flowsheet].Active"] = 1  

 ; Deactivate flowsheet 10_Flowsheet
 ["PlantModel.Page[10_Flowsheet].Active"] = 0

EndSub

Cross-page connections

Sub InitialisePreStart()
 ;--- Logic executed very early before first iteration

 ; Turn on cross-page connection in Feeder XPG_001
 ["XPG_001.ConnectionOn"] = 1

 ; Turn off cross-page connection in Feeder XPG_002
 ["XPG_002.ConnectionOn"] = 0

 ; Set cross-page connection in Feeder XPG_001 to XPG_002
 [str "XPG_001.Conn_To"] = "XPG_002"

EndSub