]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.tutorial/scl/Tutorial/2.02 Model configuration.md
Merge "Fix to OrderedSetTemplate, preference for autocompletion"
[simantics/platform.git] / bundles / org.simantics.scl.tutorial / scl / Tutorial / 2.02 Model configuration.md
1 \r
2 # Model configuration\r
3 \r
4 Apros 6.05 contains a new module `Apros/Legacy` for manipulating the model configuration\r
5 with commands that are familiar to Apros 5 developers. Idea of the module is that\r
6 all Apros entities are referred by their names in the Apros solver.\r
7 \r
8 ## Updating model configuration\r
9 \r
10 ::value[Apros/Legacy/aadd, Apros/Legacy/aaddNonvisual, Apros/Legacy/amodi, Apros/Legacy/aconnect, Apros/Legacy/aconnectWithName]\r
11 ::value[Apros/Legacy/ainclude, Apros/Legacy/aexclude, Apros/Legacy/arename]\r
12 \r
13 ## Examples\r
14 \r
15 The following commands build a point-pipe-point configuration to subprocess MYDIAGRAM.\r
16 \r
17     import "Apros/Legacy" \r
18     aadd "MYDIAGRAM" "Point" "PO01" (50, 50)\r
19     amodi "PO01" "PO11_PRESSURE" 0.2\r
20     aexclude "PO01"\r
21    \r
22     aadd "MYDIAGRAM" "Point" "PO02" (100, 50)\r
23     amodi "PO02" "PO11_PRESSURE" 0.1\r
24     aexclude "PO02"\r
25    \r
26     aadd "MYDIAGRAM" "Pipe" "PIP01" (75, 50)\r
27     amodi "PIP01" "PI12_CONNECT_POINT_1" "PO01"\r
28     amodi "PIP01" "PI12_CONNECT_POINT_2" "PO02"\r
29 \r
30 Alternatively `aconnect` can be used to create the same name reference connections:\r
31 \r
32     aconnect "PO01" "SelfPOINT" "PIP01" "PI12_CONNECT_POINT_1" \r
33     aconnect "PO02" "SelfPOINT" "PIP01" "PI12_CONNECT_POINT_2" \r
34 \r
35 Notice the attribute name "SelfPOINT" which represents the MODNAME terminal of the POINT module.\r
36 To make a reference to a module's MODNAME terminal, use "SelfMT" as the attribute name, where\r
37 MT is the module type name in uppercase.\r
38 \r
39 ## Making model queries\r
40 \r
41 The module contains also the basic commands for making model queries:\r
42 \r
43 ::value[Apros/Legacy/ashow, Apros/Legacy/alist, Apros/Legacy/alistOnly, Apros/Legacy/aget, Apros/Legacy/amget, Apros/Legacy/amgetSort]\r