For any T-FLEX CAD variable it is possible to define a list of values. To be more precise – a list of expressions since the list for the variable can include any values, not necessarily the constants. The list of various expressions can be defined even for a variable-function. After that, the value of any variable, more precisely, of any expression, determining this value, can be selected from the created list.
The list is created as a set of lines, containing required constants or expressions. Moreover, the list can be created on the basis of already existing file, internal database, the list of materials in the 3D version or the calendar two last items are available only for text variables.
The list defined for the variable will appear in all places in which the value of the given variables is specified (in the variables editor, in the External Variables command, upon assigning the variables of a fragment). The field for the entry of the values of such variable will include the graphic button which enables to call the list of values. To access the list of values, it is enough to point at this button with the cursor of the mouse and press . As a result, the list will pop up on the screen, and the new value (expression) can be selected from the list.
The list of variable’s values is created using the drop-down list located in the Value List group in the variable parameters dialog. The method by which the variable’s list is created is chosen from the pull down menu of this parameter:
•Text,
•Database,
•File,
•Date,
In order to edit the created list, it is necessary to use the Edit… button located in the Value List group in the variable parameters dialog. For each type of the list, the corresponding edit method will be called.
For removing any list of values, it is enough to select the No option in the Value List drop-down list. If the list is created on the basis of database, then only connection with the database will be broken, the database itself will be preserved.
After selecting the list creation method on the basis of text, the window of the text editor will appear, in which the necessary list of values can be formed. Each value has to be located in a separate line. Upon creating the list, all options of the text editor become available.
When the list is created on the basis of database, already existing internal database or the database at the link is used (see the Databases section). For example, let's suppose there is database shown on pictures below. After calling the command for creating the list on the basis of database, the dialog window will appear. The parameters for forming the list have to be indicated in this window.
One has to choose:
•the name of the database from the list of databases for the current document;
•the column in the database from which the values will be selected. The first line of the list – Record Number can be also chosen. In this case, the selected record number will be a value being returned;
•columns which will appear upon creating the list.
The field Filter enables to specify conditions for the values selected from the database (upon creating the list of values). These conditions are specified with the help of logic expressions, which are made up by the same rules as those for the expressions for the variables (see Expression Operations section).
For example, the use of the expression, shown on the picture above (d<5), will lead to the result shown on the picture below (for comparison, the list obtained in the same example without specifying the condition in the field Filter is shown as well).
List on the basis of database obtained with the use of filter |
List on the basis of database obtained without using the filter |
Filter may be specified using variables. For example, if we create a variable named $column, whose value is "d", and a variable named condition, whose value is 5, then, instead of the d<5 expression used before, we can use the expression {$column}<condition as a Filter.
The <> operator can be used, in order to find textual values containing a particular sub-string. E.g., if you enter the m<>$Cond expression into the Filter box, a row of database will be displayed in the list, only if a value in its m column contains the value of the $Cond variable. The <> operator is case-sensitive.
When the list is created on the basis of file, the dialog window for selecting already existing or creating the new file (file of format *.LST) appears. The data in the file must be stored in the form of sections with the lists of values. Upon creating the list, the required section is indicated. Also, it is possible to create the new section or remove already existing section from the file with the help of buttons and (buttons in the left pane of the dialog).
The list of values for the selected section is shown in the field on the right. The buttons , , and in this pane of the window enable to edit the list of values of the selected section.
The created file can be used while working with other T-FLEX CAD documents.
When the list is created on the basis of date, the dialog window pops up, in which the date representation format can be specified, for example, “DD.MM.YY”. The variable, for which this list is specified, has to be a text variable. After that, upon making a selection from the list, the window in the form of a calendar will emerge, in which any required date can be chosen.
Also, it is possible to form the list on the basis of materials list. Such list can be formed only for the text variable. Upon creating the list, the window of the text editor appears, in which all materials, used in the 3D model of the current document, are included by default. If necessary, the list can be edited manually.
See Also: