Working With Forms > The Form Objects > Selection Input

Selection Input
The Selection Input () is a form object for a selection input of some geometric entities in an application. The Selection Input object is similar to the selection settings in COMSOL Multiphysics models. Users can activate selections, and you can copy and paste selections into the list of selected entities, for example.
Enter the name of the Selection Input object in the Name field.
The Settings window contains the following sections:
Source
In this section you define the selection to use as the source. The section contains a tree with a filtered view of the tree in the Model Builder window. The nodes either represent some sort of data or have children that do. For a Selection Input, the tree contains Explicit selection nodes from the model, which you can choose as the source for the selection. That selection is then available for the application to use and contains updated selections made by the user. When you select a node that represents data, the Use as Source toolbar button () below the tree becomes enabled. You can right-click the node and choose Use as Source. You can also click the Create button () in the Source section header to create a new variable declaration and use it as the source. A Create and Use Variable dialog box opens, so that you can select the data type of the source (if applicable), its name, and its initial value. The name cannot be in conflict with any existing variable declaration. Click the Edit Node toolbar button () below the tree to move to the corresponding node. If necessary, the program switches to the Model Builder.
After selecting a node as the source, the node appears as the selected source under Selected source.
Graphics to Use When Active
When users of the application set the activation switch to ON, you can connect the selections to a Graphics object where the selected geometric entities are highlighted. Select a Graphics object from the tree and click the Use Graphics button to add that Graphics object (graphics2, for example) under Selected graphics. Users can then also make selections directly in the Graphics object. If the Graphics object is set up to include the standard plot toolbar, that toolbar also includes the Zoom to Selection (), Select Box ( in 3D), and Deselect Box () buttons. If multiple Selection Input objects are connected to the same Graphics object, only one of the selections can be active at a time.
Position and Size
This section contains all layout settings for a selection input object in the grid of the parent form.
In the grid mode, you can control the horizontal and vertical alignment of the selection input form object using the following lists:
From the Horizontal alignment list, choose Left, Center, Right, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
From the Vertical alignment list, choose Middle, Top, Bottom, or Fill, which automatically expands the form object to fill the cell in the horizontal or vertical direction (where applicable).
The need to specify the alignment is most obvious when working in the grid mode, as it controls how the form object is aligned in its grid cell. Aligning the form object can be useful in the sketch mode too, and you can then use the alignment tools on the Arrange menu in the Form toolbar’s Sketch section. When running the application in any client other than the Windows client, the form objects may not be positioned exactly as seen in the form windows. This is because the form objects may have a different size in other clients, giving them a slightly different positioning. Specifying the alignment ensures that the form objects are aligned as you want them to be in all clients.
You can also specify the width of the selection input. Enter a width (in points) in the Width field. If you have chosen Fill from the Horizontal alignment list, you can instead specify a Minimum width. Choose Automatic to compute the minimum width automatically (typically this means a minimum size of 0), or choose Manual to specify a minimum width in the text field underneath. The Height field is unavailable because the height of the input field is determined by the software.
Additionally, in the sketch mode, you can specify the form object’s absolute position using the Position x and Position y fields. In the grid mode, you can position the object in the grid and see the grid position as the Row, Column, Row span, and Column span values.
Cell Margin
Under Cell margin (in grid mode only), you can control the margins around the form object. By default, the margins are taken from the parent form. From the Cell margin list, choose:
None, to use no margin around the form object.
From parent form (the default), to use the margins set for the parent form.
Custom, to specify the margins for the form object in the Horizontal and Vertical text fields.
Appearance
In this section, you can control the appearance of the background and the text in the selection input:
From the Text color list, select Inherit (the default) to inherit the text color from the setting in the Form node, or select one of the predefined colors, such as Black. Select Custom to choose a custom text color from the color palette that opens.
From the Background color list, select a color to use as the background in the selection input: Transparent (the default), any of the predefined basic colors, or Custom, which makes it possible to select a custom color from a color palette that opens.
The font and the font size for the text in the array input fields use the font settings from the Forms node by default. Select a font from the Font list: Default font or any of the available fonts. If needed, choose or enter a font size (in points) in the Font size combo box. The default is to use the Default size for the font.
Select the Bold check box to use a boldface font.
Select the Italic check box to use italics (an italic font).
Under State, you can control the initial state of the selection input when users run the application. By default, the selection input is visible and enabled. Clear the Visible or Enabled check box if you want to make the initial state so that the selection input is hidden or unavailable. You can then make it visible or enable it using a method.