Introduction to script
In Ge there is a collection of commands to create graphic elements as rectangles, texts,
polylines and subgraphs. These commands can be executed from the command line in Ge, or
executed from script files that is executed from the command line.
The script files can furthermore contain a language similar to c, that contains operators för
calculations, if statements and for loops etc. There are also functions to fetch information
from the development database. See the manual for Wtt Script for more information.
Ge script can for example be used to convert graph from other systems to ge graphs, or to
automatically generate forms or graphs from objects in the database.
Create objects
Base objects as rectangles, lines etc. are created by the create command. Before the object
is created you set the disired properties of the editor (fill, border, fill color, text size
etc.) and then you create the object.
Rectangle
An example of a filled rectangle
set fill
set linewidth 1
set bordercolor Black
set fillcolor BlueHigh7
create rect /x1=10 /y1=1 /width=4 /height=2
Circle
An example of a half circle
set nofill
set linewidth 2
set bordercolor Black
create arc /x1=1 /y1=1 /x2=3 /y2=2 /angle1=0 /angle2=180
Line
Line example
set linewidth 1
set bordercolor Black
create line /x1=0 /y1=0 /x2=10 /y2=0
Polylinje
To create to polyline, you create the first segment with 'create', and the following segments
with 'add'.
Polyline example
set nofill
set linewidth 1
set bordercolor Black
create polyline /x1=5 /y1=5 /x2=6 /y2=6
add polyline /x1=5 /y1=7
add polyline /x1= 6/y1=8
add polyline /x1=5 /y1=9
add polyline /x1= 6 /y1=10
Text
Example
set textsize 14
set textfont LucidaSans
set textcolor RedHigh8
set bold
create text/text="Example" /x1=3 /y1=5
Subgraph object
Creating subgraphs object is a bit different. Here you create the object first, and the set
the attributes of the object.
Valve example
create object /sub=pwr_valve /x1=1 /y1= 1 /x2=3 /y2=2
set current fillcolor YellowGreenMedium4
set current attr DigLowColor.Attribute "Rt-Dv1.ActualValue##Boolean"
set current attr DigLowColor.Color GrayHigh8
Pushbutton example
create object /sub=pwr_buttonset /x1=5 /y1=1
! Change type to SetDig with Confirm
set current attr Dyntype1 DigLowColor
set current attr Action Inherit|Confirm
set current attr annotation "Start"
set current attr Confirm.Text "Do you really want to..."
set current attr SetDig.Attribute "rt-Dv1.ActualValue##Boolean"
set current attr DigLowColor.Attribute "rt-Dv2.ActualValue##Boolean"
set current attr DigLowColor.Color YellowGreenMedium4
set current attr Access System|Operator1
Graph attributes
Before saving the graph, you should state the borders in x and y direction for the graph, and
some other attributes. This is done with the command 'set graphattributes'.
Example
set graph x0 -3
set graph y0 -3
set graph x1 40
set graph y1 37
set graph AnimationScanTime 0.2
set graph BackgroundImage "corrado.gif"
Subgraph attributes
If the graph is to be saved as a subgraph, you also use 'set graphattributes'. You first set
the attribute 'subgraph' and thereafter the other attributes that belongs to a subgraph.
Example
set graph subgraph 1
set graphattr Action ToggleDig
set graphattr DynType1 DigLowColor
set graphattr Color1 YellowGreenMedium4
set graphattr NoConObstacle 1