Modules | |
Publishing results in SALOME study | |
Auxiliary data structures and methods | |
All package methods, grouped by their purpose | |
By default, all functions of geomBuilder Python module do not publish resulting geometrical objects. This can be done in the Python script by means of addToStudy() or addToStudyInFather() functions.
However, it is possible to publish result data in the study automatically. For this, almost each function of geomBuilder class has an additional theName parameter (None
by default). As soon as non-empty string value is passed to this parameter, the result object is published in the study automatically.
For example, consider the following Python script:
Last two lines can be replaced by one-line instruction:
... or simply
Note, that some functions produce more than one geometrical objects. For example, GetNonBlocks() function returns two objects: group of all non-hexa solids and group of all non-quad faces. For such functions it is possible to specify separate names for results.
For example
Above example will publish both result compounds (first with non-hexa solids and second with non-quad faces) as two items, both named "nonblock". However, if second command is invoked as
... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
Automatic publication of all results can be also enabled/disabled by means of the function addToStudyAuto(). The automatic publishing is managed by the numeric parameter passed to this function:
When automatic publishing is enabled, you even do not need to pass theName parameter to the functions creating objects, instead default names will be used. However, you can always change the behavior, by passing explicit name to the theName parameter and it will be used instead default one. The publishing of the collections of objects will be done according to the above mentioned rules (maximum allowed number of sub-shapes).
For example:
This feature can be used, for example, for debugging purposes.
It is possible to customize the representation of the geometrical data in the data tree; this can be done by using folders. A folder can be created in the study tree using function NewFolder() (by default it is created under the "Geometry" root object). As soon as folder is created, any published geometry object can be moved into it.
For example:
Subfolders are also can be created by specifying another folder as a parent: