Create Control

Предыдущая страницаВ началоСледующая страница

Upon calling the command, the following options become available in the automenu:

CreateNewControl

<S>

Create Dialog Page

CEFrame

<F>

Frame

CEText

<T>

Static Text

CETextEditor

<E>

Edit Box

CEGroupe

<G>

Group Box

CEButton

<B>

Button

CESwitch

<C>

Check Box

CESwitch2

<R>

Radio Button

CEList

<O>

Combo Box

CEPreview

<V>

Preview

Parameters

<P>

Edit Control Parameters

clip0355

<A>

Set absolute coordinates

Line3DNode

<N>

Set relation with Node

EditIcon

<F4>

Edit Control

AutomenuCancel1

<Esc>

Exit command

Creation of All control elements can be fit in the following scheme:

1. Defining the size and position of the element being created. This is done by specifying two diagonal points of the box defining the element extents on the dialog page.

2. Defining the element parameters in the Control Parameters dialog box. This dialog is launched automatically.

3. Defining additional parameters - of the variable bound to the control, or of the sequence of actions performed upon activating the control.

Depending on the type of the control, some of the steps in this scheme can be skipped. For example, when creating the Frame and Preview controls, all you need to specify is the position. Other parameters of these controls are defined by default. Additional parameters need to be defined only for the elements Edit Box, Combo Box and Button.

The CreateNewControl (<S>) option creates a new page (by default it is assigned the Dialog type) with the recommended dimensions. Those in the Set Document Parameters command (Paper tab), the User format is set for it with the appropriate height and width. When a page is created, it is added to the list of pages on the External Variables tab in the Set Document Parameters command and is marked with a checkbox opposite the page name. This means that the dialog created on this page using the controls will appear on the screen when the External Variables command is called and in the dialog box for setting the values of the external variables of the fragment when the current document is used as an assembly element.
The controls do not have to be on a separate page. You can place them on any of the existing pages or create a new page for them using the Pages command.

If there are several dialog pages marked with flags in the Pages edit mode, one dialog with tabs is created. The number of tabs corresponds to the number of marked pages (the name of the tab is the same as the name of the corresponding page).

Frame CEFrame. This element is created to decorate the dialog box. You must specify two points that define the border of the frame. In this case, a rectangular area of the specified dimensions will be displayed in the dialog window. In the parameters for the frame, you can specify its type (Frame or Rectangle) and color (sets the color of the frame lines or the background color of the rectangle).

Static Text CEText is also used to decorate the dialog box. This element is a text string located in the specified area of ​​the dialog window. Pick two points that define the boundaries of the rectangle in which the text will be positioned. After that, the parameters window will appear on the screen, in which you can set:

the content of the text in the Capture field;

system-wide parameters Level, Layer;

text color and background color on which the text will be displayed. To change the default values, check the boxes next to the name of the corresponding parameter.

the vertical and horizontal alignment mode determines the position of the text relative to the borders of the selected rectangle.

on the Font tab you can set the text font parameters.

Edit Box CETextEditor - rectangular field for editing the value of the associated variable. Specify two points that define the boundaries of the variable value input field. Then the Expression Constructor window appears, containing a list of existing external variables. Setting the Real, Text flags determines the presence of variables of the corresponding type in the list. To assign a variable, point to an element of the variable list with the cursor and press Левый клик Текст (the variable name will appear in the Expression field) or enter the variable name in the Expression field. When you enter the name of a non-existent variable, the dialog for creating a new variable is called. After confirmation, a new external (by default) variable with the specified value is created.
The parameters of this type of control are:

Multiline EditBox.

Show Expression. This parameter affects the work with the custom dialog when using variables. Usually, if, when inserting a fragment into an assembly, a link to an assembly variable is assigned in the control input field or an expression is entered, the name of the assembly variable (expression) is not shown in the dialog. This option enables the display of variables in dialog fields. In this case, the value of the assembly variable or expression is displayed next to the input field.

Read Only. When this checkbox is enabled, the editor will work in the "read-only" mode, i.e. the editor field will reflect the value of the associated variable, but this value cannot be changed.

System-wide parameters Level, Layer.

text color and background color on which the text will be displayed. To change the default values, check the boxes next to the name of the corresponding parameter.

on the Font tab you can set the text font parameters.

It should be noted that when specifying the values ​​of text variables, you can enter multi-line text. To do this, the Multi-line editor flag must be set in the control's parameters, and the characters "\n" (<Shift><Enter>), which are a line break sign, must be added to the contents of the text variable.

Group CEGroupe is another element of the dialog box design. A group is a combination of the previous two elements, i.e. it is a frame with text positioned at the top border. The parameters are set in the same way.

Button CEButton. When creating a button, you can assign a sequence of actions to be performed after clicking on it. The first step is to specify two points that determine the size of the button and its position in the dialog box. Then, in the parameters window in the Text field, enter the name of the button and, if necessary, the following parameters:

system-wide parameters Level, Layer;

text color (to change the default value, check the box next to the name of the corresponding parameter);

vertical and horizontal alignment mode (determines the position of the text relative to the borders of the button);

on the Font tab you can set the text font parameters.

After confirming the parameters (pressing the OK button), the Actions window appears, in which you must define the action (sequence of actions) that will be performed when this button is pressed.

Dialogs2

Such actions can be:

Activate Page (show contents of the specified page in the current dialog box);

Open Page in Dialog Box  (displays the dialog box contained on the specified page, in a new window);

Set Variable Value  (assigns the specified value to the selected variable).

Run Macro (a macro is a program written in some programming language using T-FLEX CAD API functions.

Regenerate 3D Model.

Open Model (open document of T-FLEX CAD);

Edit Fragment Variables (open the edit dialog for variables of the specified fragment);

Run Command (it is a tool for applications developers; the application identifier and the name of the command that processes this application are specified. When clicking on the specified application, the call with the command’s name is initiated).

Dialogs3

Zoom Limits (maximizes the image in the same way as the Zoom Limits command).

1. Add Action. Select one of the actions from the list.

Click the Add button. Depending on the selected action, a window will appear for specifying additional settings for the action (for each type of action, additional parameters will be different). After that, the action is added to the list of actions for the created button.

2. Delete Action. Specify the required line in the list of actions (it will be highlighted) and click the Delete button.

3. Properties Action. Specify the required line in the list of actions (it will be highlighted) and click the Properties button (a dialog will appear for selecting additional settings for the action).

4. Move Action. The order in which the actions are performed corresponds to the order in which they appear in the list. To change the order of actions, specify the required line in the list of actions (it will be highlighted) and move it using the Up or Down buttons.

It should be noted that the actions assigned to the button are performed in the order in which they are assigned. If the sequence includes calling a dialog, all subsequent actions after it will be performed only after closing this dialog by pressing the <OK> key. If the call to the dialog ended by pressing the <Cancel> key, then all subsequent actions are ignored.

Check Box CESwitch. This element allows you to set one of two values ​​for the selected variable, depending on the state of the switch. The first step is to specify two points that define the area of ​​the switch. Then the Expression Constructor window appears, in which all external variables existing in the document are located. Flags Real, Text control the presence of variables of the corresponding type in the list. Select the variable in the list, the value of which will be controlled by the created switch, and confirm the selection by pressing OK. Next, the parameters window will appear on the screen, in which you can set:

Set Variable Value. On - the value that is assigned to the variable when the switch flag is set, Off - the value that is assigned to the variable when the switch is off. The required value (numeric or symbolic) is entered into each parameter. If the field is left blank, the variable is assigned a null value (empty string).

Caption. Sets the text for the name of the switch.

system-wide parameters Level, Layer;

Text color. To change the default value, check the box next to the name of the corresponding parameter. The background color determines the color of the area highlighted for the radio button.

the vertical and horizontal alignment mode determines the position of the title text in relation to the area boundaries.

on the Font tab you can set the text font parameters.

Radio Button CESwitch2. This element allows you to change the value of the selected variable. This type of switch is convenient to use if there are several variants of its value for a variable (in the case of two values, the previous type of switch can be used). Then a group of radio buttons is created for this variable, each of which sets one of its values (for example: the Step variable can take values: small, medium, large).

This type of switch is created in the same way as the previous one. The only difference is the unavailable value of the Off parameter.

Combo Box CEList. The combo box is created for the user to enter the values ​​of a variable and/or select it from the list. It should be noted that the creation of the list and the entry of its contents is carried out in the variable editor. As with other controls, you first set two points that define the area of ​​this item (the value edit field and the list button occupy the entire selection). Then the Expression Constructor window appears to select a variable, the value of which will be changed by the created element. If necessary, you can set the following values ​​in the parameters:

Editable (For ComboBox). When the flag is set, it is allowed to edit the value of the variable, otherwise only selection from the list is possible.

Show Expression. This parameter affects the work with the custom dialog when using variables. Usually, if, when inserting a fragment into an assembly, a link to an assembly variable is assigned in the control input field or an expression is entered, the name of the assembly variable (expression) is not shown in the dialog. This option enables the display of variables in dialog fields. In this case, the value of the assembly variable or expression is displayed next to the input field.

Value Selection. It is used to link the values of external variables with each other. For example, automatically select the appropriate thread pitch from the list when changing the thread diameter. If this option is disabled, the thread pitch will not change depending on the diameter.

ControlPanel1

system-wide parameters Level, Layer;

Text color. To change the default value, check the box next to the name of the corresponding parameter. The background color determines the color of the area highlighted for the radio button.

on the Font tab you can set the text font parameters.

If the list of variable values ​​was created based on a file, then by enabling the Editable option, you can change the list right on the dialog page. To do this, point the cursor to the input field and call the context menu with the right mouse button. The Add to List command allows you to add the contents of a value input field to the list of values ​​for a variable. The Edit List command allows you to change the values ​​of the list items.

If the list of values ​​contains a comment (a text string separated by the “;” symbol from the variable value), then if the Editable parameter is disabled, the input field of the control and its drop-down list will reflect not the numeric values ​​of the variable, but their text alternatives.

Preview CEPreview. This element allows you to display a preview window in the dialog for editing external variables of a fragment (in the dialog of the External Variables command, the preview is not displayed). To display the drawing in the viewing area when calling the dialog in the External Variables command, you can align the positions of the Preview control and the Picture element of the image. Unlike the preview, the picture is not associated with the drawing file and therefore will not change when the values ​​of the variables are changed. The viewport displays the page corresponding to the selected anchor vector. Pick two points that define the size and position of the viewport. The following fields are available in the parameters:

frame type (frame, rectangle);

system-wide parameters Level, Layer;

The next three parameters have no effect on this type of control.

color, background color;

horizontal and vertical alignment mode;

on the Font tab you can set the text font parameters.

Controls have an order that affects the transition to the next element when the <Tab> and <Shift-Tab> keys are pressed, and a priority that determines the order in which the item images are stacked. By default, both properties are set by the sequence of elements creation (i.e., transitions will be performed from the first created element to the next, and the element's image has a higher priority than the previous one, but less than the next one). You can reassign the order of elements (and hence the priority) in the command for editing controls.

ExternalVariables2

For existing controls, the Copy, Move options are available in the context menu, allowing you to create new elements by copying or change the position of the selected element.

In the free T-FLEX CAD tutorial there is a lesson on creating a control dialog - Parameterization, Lesson 3 - Control Dialog Creation. You can download the tutorial at the corresponding link.