General Functions
This section describes the general functions available in SAInt. These functions are used to interact with objects via the map window, to edit the object’s properties in the editor, to navigate the map window or to change the display time.
The functions are listed in Section 1 with their syntax, description, and output examples. The syntax of the functions includes expr
which refers to the input expression. The examples shown are based on the dynamic scenarios of the sample electricity (ENET09_13) and gas (GNET29_18) networks available in the user’s Projects folder (C:\...\Documents\encoord\SAInt-v3\Projects
). Please consider the type of object used in the expression to select the correct network. Scenario results must be available for the expression to be executed correctly in the command window. Note that the sample electricity (ENET09_13) model uses a stochastic profile for the hydro reservoir. This is why the user may get different results from the ones presented here or each time the same command is used in the active session of SAInt.
The user can easily copy and paste the code in the command window and replicate the examples.
1. General functions description
1.2. The function edit
edit('expr')
Opens the property editor for the object specified in the input expression. Multiple objects of the same type can be specified. A multi-edit session will be activated in the property editor for the common properties.
Examples:
edit('GNO.%')
-
Opens a multi-edit window to edit common properties for all gas nodes in the network. All 29 nodes are selected for editing.
edit('GNO.CGS_12.!GDEM.%')
-
Opens the property editor for editing the properties of the gas demand external connected to gas node GNO.CGS_12. We have used
%
to make sure to select all possible demand externals. edit('EZN.RURAL.!LI.%')
-
Opens a multi-edit window to edit common properties for all electric lines, connected to electric zone RURAL. Five lines are selected.
1.3. The function time
time('expr')
Changes the display time on the map window.
Examples:
time('+1')
-
Increases the display time of the map window by one hour.
time('04/01/2022 00:00')
-
Changes the display time to the date and time specified in the expression.
time('1/5')
-
Increases the display time by one day and five hours.
1.4. The function path
path('startnode','node(1)',..,'node(n)','endnode')
The function selects the shortest path from the start node to the end node. The path also covers the intermediate nodes if specified in the input expression.
Example:
path('GNO.CN_07','GNO.CN_05','GNO.CGS_03','GNO.CGS_01')
-
Marks the shortest path from gas nodes CN_07 to CGS_01 through the intermediate nodes CN_05 and CGS_03. Mandatory arguments are: 'startnode' and 'endnode'.
1.5. The function zoom
zoom('expr(1)',..,'expr(n)')
Zooms to the object(s), specified in the input expression, on the map window. It can also zoom to the object(s) based on a given condition (conditional expression). At least one expression is mandatory for the function to zoom in the active map view window.
It is possible to specify the name of the map view where to perform the zoom operation. Simply append to the object expression selecting the objects you want to zoon on with Map_View_Name
.
Examples:
zoom('ENO.(%)')
-
Zooms to all electric nodes.
zoom('GNO.CGS_01','GNO.CGS_03')
-
Zooms to gas nodes CGS_01 and CGS_03 on the gas network map.
zoom('EZN.INDUSTRIAL.!FGEN;Map 1')
-
Zooms to all fuel generators in the electric zone INDUSTRIAL on Map 1.
zoom('FGEN.%.FuelName == "GAS"')
-
Zooms to all electric nodes containing the fuel generators that uses the fuel GAS.
1.6. The function mark
or unmark
mark/unmark('expr')
The function marks or unmarks the object specified in the expression in the active map window. The input expression can also be a conditional expression allowing to select objects on certain criteria. The two functions accept more than one expression. At least one expression is mandatory for the function to work.
Examples:
mark('GSUP.(%)')
-
Marks all gas nodes containing gas supply objects on the map window.
mark('GSUP.(%)','GCS.(%)')
-
Marks all gas nodes containing gas supply and compressor objects on the map window.
mark('GSUP.%.NQ!X_C1 > 95')
-
Marks all gas nodes containing the gas supply objects, with a molar percentage of methane (C1) greater than 95 %, on the map window.
1.7. The function find
find('expr')
Checks the existence of the specific object given in the input expression. It can also find the object based on a given condition (conditional expression). Returns the ObjectType.ObjectId in case of existence and Object not found in case of non-existence. At least one expression is mandatory for the function to work. Multiple expressions could be used as arguments.
Examples:
find('GNO.LNG')
-
Checks the existence of the gas node LNG.
find('ENO.Node1.!EXT.%')
-
Returns a list of all externals connected to electric node Node1.