Selecting Entities with the Mouse

The following discussion is applicable only to the command line version of Trelis. See GUI Entity Selection for a description of interactive entity selection with the Graphical User Interface. Also refer to Extended Selection Dialog to learn how to use Python scripts to create extensive selection capabilities.

Many of the commands in Trelis require the specification of an entity on which the command operates. These entities are usually specified using an object type and ID (see Entity Specification) or a name. The ID of a particular entity can be found by turning labels on in the graphics and redisplaying; however, this can be cumbersome for complicated models. Trelis provides the capability to select with the mouse individual geometry or mesh entities. After being selected, the ID of the entity is reported and the entity is highlighted in the scene. After selecting the entities, other actions can be performed on the selection. The various options for selecting entities in Trelis are described below, and are summarized in Table 1:

Table 1. Picking and key press operations on the picked entities

Key
Action
ctrl + B1
Pick entity of the current picking type.
shift + ctrl + B1
Add picked entity of the current picking type to current picked entity list.
tab
Query-pick; pick entity of current picking type that is below the last-picked entity.
n
Lists what entities are currently selected.
l
Lists basic information about each selected entity. This is similar to entering a List command for each selected entity.
g
Lists geometric information about the selection. As if the List Geometry command were issued for each entity. If there are multiple entities selected, a geometric summary of all selected entities is printed at the end, including information such as the total bounding box of the selection.
i
Makes the current selection invisible. This only affects entities that can be made invisible from the command line (i.e. geometric and genesis entities.)
s
Draws a graphical scale showing model size in the three coordinate axes. This is a toggle action, so pressing the 's' key again in the graphics window will turn the scale off.
ctrl + z
Zoom in on the current selection.
e
Echo the ID of the selection to the command line.
a
Add the current selection to the picked group. Only geometry will be added to the group (not mesh entities). If a selected entity is already in the picked group, it will not be added a second time.
r
Remove the current selection from the picked group. If a selected entity was not found in the picked group, this command will have no effect.
ctrl + r
Redisplays the model.
c
Clear the picked group. The picked group will be empty after this command.
m
Lists what entities are currently in the picked group.
d
Display and select the entities in the picked group.
ctrl + d
Draws the entity that is selected.

Details of selecting entities with a mouse are outlined in the following items:

Entity Selection

Selecting entities typically involves two steps:

1. Specifying the type of entity to select

Clicking on the scene can be interpreted in more than one way. For example, clicking on a curve could be intended to select the curve or a mesh edge owned by that curve. The type of entity the user intends to select is called the picking type. In order for Trelis to correctly interpret mouse clicks, the picking type must be indicated. This can be done in one of two ways. The easiest way to change the picking type is to place the pointer in the graphics window and enter the dimension of the desired picking type and an optional modifier key. The dimension usually corresponds to the dimension of the objects being picked:

Table 2. Picking Modes in Graphics Window

Number Default pick Number +shift pick
0 vertices nodes
1 curves edges
2 surfaces all 2D elements
3 volumes all 3D elements
4 bodies  

If a Shift modifier key is held while typing the dimension, the picking type is set to the mesh entity of corresponding dimension, otherwise the geometry entity of that dimension is set as the picking type. For example, typing 2 while the pointer is in the graphics window sets the picking type so that geometric surfaces are picked; typing Shift-1 sets the picking type so that mesh edges are picked. To differentiate between picking "tris" or "quads" use "pick face" or "pick tri"

The picking type can also be set using the command

Pick <entity_type>

where entity_type is one of the following: Body , Volume , Surface , Curve , Vertex , Hex , Tet , Face , Tri , Edge , Node , or DicerSheet .

2. Selecting the entities

To select an object, hold down the control key and click on the entity (this command can be mapped to a different button and modifiers, as described in the section on Mouse-Based View Navigation). Clicking on an entity in this manner will first de-select any previously selected entities, and will then select the entity of the correct type closest to the point clicked. The new selection will be highlighted and its name will be printed in the command window.

Query Selection

If the highlighted entity is not the object you intended to selected, press the Tab key to move to the next closest entity. You can continue to press tab to loop through all possible selections that are reasonably close to the point where you clicked. Shift-Tab will loop backwards through the same entities.

Multiple Selected Entities

To select an additional entity, without first clearing the current selection, hold down the shift and control keys while clicking on an object. You can select as many objects as you would like. By changing the picking type between selections, more than one type of entity may be selected at a time. When picking multiple entities, each pick action acts as a toggle; if the entity is already picked, it is "unpicked", or taken out of the picked entities list.

Information About the Selection

When an entity is selected, its name, entity type, and ID are printed in the command window. There are several other actions which can then be performed on the picked entity list. These actions are initiated by pressing a key while the pointer is in the graphics window. Table 1 summarizes the actions which operate on the selected entities.

Picked Group

There is a special group whose contents can be altered using picking. This group is named picked , and is automatically created by Trelis. Other than its relationship to interactive picking, it is identical to other groups and can be operated on from the command line. Like other groups, both geometric and mesh entities can be held in the picked group. Table 1 lists the graphics window key presses used with the picked group.

Note: It is important to distinguish between the current selection and the picked group contents. Clicking on a new entity will select that entity, but will not add it to the picked group. De-selecting an entity will not remove an entity from the picked group.

Substituting Selection into Other Commands

There are three ways to use mouse-based selection to specify entities in commands.

1. The Selection Keyword

You may refer to all currently selected entities by using the word selection in a command; the picked type and ID numbers of all selected entities will be substituted directly for selection . For example, if Volume 1 and Curve 5 are currently selected, typing

Color selection Blue

is identical to typing

Color Volume 1 Curve 5 Blue

Note that the selection keyword is case sensitive, and must be entered as all lowercase letters.

2. Echoing the ID of the Selection

Typing an e into a graphics window will cause the ID of each selected entity to be added to the command line at the current insertion point. This is a convenient way to use entities of which you don't already know the name or ID.

As an added convenience, the picking type can be set based on the last word on the command line using the ` key. Note that this is not the apostrophe key, but rather the left tick mark, usually found at the upper-left corner of the keyboard on the same key as the tilde (~). For example, a convenient way to set the meshing scheme of a cylinder to sweep would be as follows:

Volume (hit `, select cylinder, hit e) Scheme Sweep Source Surface (hit `, select endcap, hit e) Target (select other endcap, hit e)

The result will be something similar to

Volume 1 Scheme Sweep Source Surface 1 Target 2

Notice that you must use the word Surface in the command, or ` will not select the correct picking type.

3. Using the Picked Group in Commands

Like other groups, the picked group may be used in commands by referring to it by name. The name of the picked group is picked. For example, if the contents of the picked group are Volume 1 and Volume 2, the command

Draw picked

is identical to

Draw Volume 1 Volume 2

Note that picked is case sensitive, and must be entered as all lowercase letters.

Select Commands

Creating and Modifying Selections

The following commands may be used to create a new selection or modify the current selection.

Select <entity_list> [add|remove]

This command selects the specified entities. If the add option is specified, the entities are added to the current selection. If the remove option is specified, the entities are removed from the current selection. If neither is specified, the current selection is replaced with the specified entities.

Select None

This command clears the selection.

Select Seed {face <ids>|tri <ids>} feature_angle <angle>

This command creates a new selection based on a seed face and feature angle. It finds all the neighboring faces with a feature angle that is less than the specified angle and adds them to the selection.

Rubberband Selection Control

The following commands control the behavior of rubberband selection.

Select Occluded {on|off}

When turned on, the selection will include entities that are occluded, or hidden behind other entities, in the current graphics view.

Select Partial {on|off}

When turned on, the selection will include all entities that touch the rubberband. When turned off, the selection will include only entities that lie completely within the rubberband region.

Select Rubberband Shape {box|polygon|circle}

Choose the rubberband shape to be box, polygon, or circle. If polygon is selected, the shape of the polygon is defined by the left mouse button clicks in the graphics windows. To end defining the polygon shape and make the selection, click the right mouse button.