Assigning expressions in the mini-dialog boxes
You can assign expressions in any think3 application command that uses mini-dialogs. You can type an expression in the mini-dialog with a numerical input associated.
Once the expression has been confirmed (after you click TAB), it is evaluated and the computed value is inserted in the mini-dialog. Depending on the ability of the command to manage associativity, the reference to the expression may be kept (as in feature creation commands) or lost (as in 2D commands). In the first case, the expression defines the "rule" of the associativity; in the second case, the expression is used just to define a numerical value.
The mini-dialog always shows the value (the result of the expression evaluation). The expression will appear in the mini-dialog when you click on it and start editing; during this phase you can type an expression using the GPL standard operators (+,-, etc.) and [user-] functions (cos, sin, etc.), spreadsheet variables and Adaptive Measures (through the standard tool).
Expression Definition
An Expression is a mathematical formulation combining Operators and Operands that evaluates single numerical values.
The Operator can be a:
- GPL operator and function.
- GPL user defined function.
The Operand can be a:
- Spreadsheet variable
- Measure
- Numerical value
The system also provides appropriate feedback to facilitate the comprehension of a mini-dialog and/or expression: icons to highlight an associative expression, tooltip to display the expression when the mini-dialog shows the value, tooltip to display the value of a variable, graphical highlight of the specific measured geometry, etc.
An "associative" expression may generate loops (typically in spreadsheet variables and Adaptive Measure uses). When you apply the command, the system warns you about the potential loops.
Expression Editing
In a mini-dialog, you can:
- Insert a numerical value.
- Insert a variable:
Assume you create a variable A and confirm the editing (by pressing TAB). The possible scenario are:
- A is an existing variable. The mini-dialog assumes its value and associates the value to the variable, if the corresponding mini-dialog parameter is associative.
- A is not an existing variable. A new variable will be automatically created and its value will be equal to the current mini-dialog value. Moreover it will be linked to the mini-dialog if its related parameter is associative.

- Insert an Adaptive Measure:
The Adaptive Measure tool, can be activated through the:
- Context Menu on a mini-dialog: If you type an expression, the Adaptive Measure is placed in the current cursor position or replaces the selected sub-expression. If you do not type the expression, the Adaptive Measure defines the expression or value of the mini-dialog. In case of commands that have the preview attached to the cursor (e.g.: Line, Rectangle, Mating, etc.), the Adaptive Measure tool cannot be activated through the Context Menu on the mini-dialog, when you do not type an expression.

- Context Menu in the graphic area: The Adaptive Measure defines the expression or value of the current mini-dialog.

- Toolbar button (TBD): If you type an expression, the Adaptive Measure is placed in the current cursor position or replaces the selected sub-expression. If you do not type the expression, the Adaptive Measure defines the expression or value of the mini-dialog.
- If you define a measure and edit the mini-dialog:
- In case of associative parameter (e.g. Linear sweep, Mating), a symbol "$i" ("i" is a progressive number) appears in the mini-dialog in the cursor's position or replaces the selected sub-expression.
- In case of non associative parameter (e.g. Line, Rectangle), the value of the measure appears in the mini-dialog in the cursor position or replaces the selected sub-expression.
- If you define a measure and do not edit the mini-dialog, the computed value always appears in the mini-dialog. You can still edit the mini-dialog and click to compose the expression. Once the editing starts, if the corresponding mini-dialog parameter is an associative one, the "$i" (where "i" is a progressive number) symbol appears in the mini-dialog replacing the measure value.
You can also redefine the inserted adaptive measure. When you are in edit more, select the measure symbol and the standard adaptive measure mini-dialog appears. When you click the mini dialog, you can change its type and its reference. If you do not edit the mini-dialog, you can choose Enable Adaptive Measure and the mini-dialog appears, showing the current values of the measure; again you can click and change its type and references.
- Insert an expression:
You can type any expression composed by variable, numerical value, measure linked together using GPL operators and functions.
- Create a variable and assign to it the entire expression or a sub-expression:
This functionality can be activated through the Make Variable context menu item on the mini-dialog.

Note
If you edit the mini-dialog, you can select the sub-expression that you want to associate to a variable and create the variable using the appropriate context menu item. |
The system requires a name for the variable; once it has been typed, it appears in the mini-dialog replacing the selected sub-expression.
These variables are created in the Spreadsheet. If you do not edit the mini-dialog, the variable is always assigned to the entire expression or value of the mini-dialog and it appears in the mini-dialog at the next editing. These variables are not removed when the command exits, even if they are no longer used.
- Unlink the entire expression or a sub-expression replacing it with the result of its evaluation:
This functionality can be activated through the Unlink context menu item on the mini-dialog.

If you edit the mini-dialog, you can select the sub-expression that you want to unlink and use the appropriate context menu item. The selected sub-expression is evaluated and its numerical value is inserted in the mini-dialog.

After you unlink the expression, the simple computed value will be replaced.

If you do not edit the mini-dialog, the entire expression is unlinked.
You can use the Break Variable command to replace a variable with its expression; it can be activated through the context menu on the mini-dialog and it is available in editing and idle mode.
- Copy, Cut and Paste of sub-expressions:
This functionality can be activated through the context menu on the mini-dialog. It allows you to move or copy variable, measure or any sub-expression to another part of the expression of the source mini-dialog or to any another mini-dialog.
Deleting a variable
To delete the variable created using Make Variable command, you have to first unlink the variable, exit from the command and delete it in the Spreadsheet.
Related Topics