3 In this exercise, we write points and pipes of a
\r
4 diagram in the same format used earlier for reading.
\r
10 ::value[Simantics/DB/relativeResource]
\r
14 ::value[Simantics/DB/currentModel]
\r
16 to define a variable `dia` that refers to some composite (configuration element
\r
17 corresponding to a diagram). Create some content (points and pipes) to
\r
20 Print the value to the console and check that it corresponds to the
\r
21 resource id given by the graph debugger.
\r
25 Import the ontology `http://www.simantics.org/Layer0-1.1` as `L0`.
\r
29 ::value[Simantics/DB/#]
\r
31 and `L0.ConsistsOf` to find all children of `dia`.
\r
32 Print their names using
\r
34 ::value[Prelude/map, Simantics/DB/nameOf]
\r
38 Import the ontology `http://www.apros.fi/Combustion/Configuration-6.0` as `Conf`.
\r
40 Modify the commands in step 2 to find only the points (`Conf.ModuleTypes.POINT`) of the diagram.
\r
44 Print the names and elevations of all points in `dia` using the function
\r
46 ::value[Simantics/DB/relatedValue]
\r
48 and the attribute `Conf.Relations.PO11_ELEV`.
\r
52 Use the relation `http://www.simantics.org/Modeling-1.2/ElementToComponent`
\r
55 ::value[Simantics/DB/singleObject]
\r
57 to find the graphical symbol of the point.
\r
59 Use the relation `http://www.simantics.org/Diagram-2.2/HasTransform` and
\r
61 ::value[Simantics/DB/relatedValue]
\r
63 to read the transformation of the point. The last two elements of the transformation
\r
64 are the coordinates of the point.
\r
68 Give an indices for all points you find for example using
\r
70 ::value[Prelude/range, Prelude/zip]
\r
74 Print the data about the points in the format described in
\r
75 the previous pipelines exercise.
\r
79 Print the corresponding data about the pipes.