Selection Input
In the Application Builder, you can allow the user of an application to interactively change which entities belong to an Explicit selection with a Selection Input object or a Graphics object. For more information on selections, see Selections.
You can choose to use a graphics object as the source of a selection without having any selection input object. You can also link both a graphics object and a selection input object to the same explicit selection.
In the example below, the embedded model has a boundary condition defined with an Explicit selection. Both a Selection Input object and a Graphics object are used to let the user select boundaries to be excited by an incoming wave.
The user can select boundaries here by clicking directly in the graphics window corresponding to the Graphics object or by adding geometric entity numbers in a list of boundary numbers corresponding to a Selection Input object.
To make it possible to directly select a boundary by clicking on it, you can link a graphics object to an explicit Selection used to group boundaries, as shown in the figure below. Select the explicit selection and click Use as Source.
In the figure below, there are two explicit selections, Excitation Boundary and Exit Boundary, and the graphics object graphics2 is linked to the selection Excitation Boundary.
When a graphics object is linked directly to an explicit selection in this way, the graphics object displays the geometry and the user can interact with it by clicking on the boundaries. The boundaries will then be added (or removed) to the corresponding explicit selection.
To make it possible to select by number, you can link a selection input object to an explicit selection, as shown in the figure below.
In a selection input object, you can copy, paste, remove, clear, and zoom into selections.
You can have events associated with selections. The On data change event will be triggered when the selection is changed. If you have a local method associated with this event, you will get a method with an integer array argument. The method is called with the new entities of the selection. The On activate event will be triggered when the Activate Selection button is clicked.
Note that you can also use a global event triggered by a selection change, as illustrated by the figure below, where the method runOnEvent is run each time a selection is changed.