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

Note: Separate tags for Activate / Deactivate. These cannot be set to 0.
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

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