# Variable definition

### Variable definition, properties of variables

Variables can be edited in the variable list or in the 'Variable Definition' dialog. The list allows variables to be created quickly, provides a good overview, and maintains the order. The dialog offers additional properties for the variables. The columns described below appear in the variable list; the other entries appear in the 'Variable Definition' dialog.

* Entering values in the dialog is recommended for supplementing the description and for easier input of enumerations (lists for drop-down lists).
* In the list for defining variables, the order can be changed arbitrarily, and new variables can be inserted or deleted at any position. The illustrated buttons to the right below the list are used for this.

**Column F / fixed value,..:**\
If this checkbox is selected, the value cannot be changed (14.03) (in earlier versions, the variable was also not shown in the variable query). Fixed values are used to define values that are to be processed as variables in the combined element, but which the user cannot change when inserting.

**Column E /..,external,..**\
This identifier reverses the hierarchy for transferring the variable value: if the variable exists at a higher level, the value from the higher level is adopted.

> Example: The same variable is defined in a structure and in a combined element. Normally, the value of the combined element applies in the combined element. Now, however, the variable in the combined element is set to external:
>
> * If the variable is set in the structure, the value from the structure is transferred to the combined element and applies there. In the variable query when calling the combined element, the variable is shown with the value from the structure. The default value can be overwritten (14.03):
> * If a variable value is adopted from an external source, the input field is highlighted in green. If the default value changes, the change is adopted as well.
> * If the default value is overwritten, the field is highlighted in red. Even if the default value changes, the manually entered value remains unchanged.
> * If I select the manually entered value and delete it with the 'Delete' key, the default value appears again and the field is highlighted in green.
> * If the variable is not set in the structure, the value from the combined element applies. In the variable query when calling the combined element, the variable is shown with the value from the combined element and can be changed.
> * If the variable is not to appear in the variable query, column U is additionally set (14.03), and the variable becomes 'invisible'. (In earlier versions, column F was set instead, i.e., the variable was set as a fixed value).
>
> The variable from the structure must also be defined in the combined element (point symbol or HRB) so that it can be used there in the formula editor.

**Column U /..,invisible,..(14.03)**\
By default, all variables, whether fixed values or external variables, are now shown during input. If a variable is not to be shown, it is set to 'invisible' with this identifier.

> When existing variable definitions are imported (before 14.03), previous fixed values are automatically set to 'invisible' so that these entries behave as before.

**Column Variable / variable name:**\
This is the name of the variable used in formulas. In the variable list, the browser button next to the variable name can be used to access stored variable sets. A single variable can be selected and adopted from any variable set.

**Column Variable query / variable query:**\
This text appears in the 'Variable Query' dialog. It offers the value of the variable for modification. In the selection of the formula editor, it also serves as a short description of the variable.

**Column Suggested value / suggested value:**\
At the first variable query, this value is suggested for the variable. In the variable query, the values of the variables can be reset to the suggested values using the 'Default values' button.

**Column Unit / ..,unit:**\
The unit of the variable is defined here. This determines the possible inputs and, if necessary, the browsers for input support. Further description of units is given below.

**Image / reference image:**\
The selected image is displayed in the variable query for this variable. The reference image is an important aid for the user when inserting the combined element, because the meaning of the variable can often best be shown in the image. However, the reference image can also be important documentation of the meaning of the variable for the creator of the combined element.\
The selected reference image is also displayed for subsequent variables until a new reference image is defined for a variable.\
Further information on reference images can be found in the corresponding chapter.

**Variable group:**\
The variable can be assigned to a group. This group is used to structure the variables in variable definition, variable query, in the selection of individual variables from the stored variables, and in the selection in the formula editor. If no variable group is specified, the variable automatically belongs to the 'General' group.\
\
In variable definition, the groups are displayed as buttons. The list of variables remains complete; the variables of the current group are highlighted in blue, those of the other groups in gray. The list jumps to the first variable of the group. All variables remain editable.\
\
If more than one variable group is present in the variable query, a subdialog is offered for each variable group. This is opened via a button with the group name. A button is automatically created above the variables for each variable group.

**Variable display:**\
Variables can be inserted into multi-line texts of plan elements. Internally, the variable name is stored, but this is partially unsuitable for reading. When the text is edited, the variable display is shown for the variable, if available. Example: For entering the delivery date in the default values, the variable **V\_LDat** is used. If the variable display is defined as **Delivery date**, then when editing the text the variable is shown as **#Delivery date#** (and not as **#V\_LDat#**)

**Variable condition:**\
(20.02) The variable condition can be used to hide the variable in the variable query for structure default values or combined elements. The queries can therefore be adapted to the input situation. This is used, for example, to query only certain variables at a window in input situation A (architecture), and additional variables in input situation K (construction). For control, the standard variable **V\_VarSit** is set in the default values of the project or the structure position and queried in the variable conditions.

> (20.03) However, the other variables of the current dialog can also be used in the variable condition. If one variable affects the display of other variables, the dialog is rebuilt after a change; the display can therefore depend on other variables. This is used, for example, to query a value only when a certain option has been selected.
>
> * If **V\_VarSit** is set in the dialog, the value set there applies. This must be considered if the display is to be controlled from outside, i.e., from the structure or project. **V\_VarSit** must then be set to external if it is to be present in the current variables.
> * Preferably, **V\_VarSit** should be an enum with, for example, the values\
>   **S: Standard; A: Architecture; W: workshop planning; K: construction; X: administrator**.
> * In the conditions, it is advisable to query the values using wildcards so that texts can also be adjusted in the default values. The condition **(V\_VarSit={A\*})** works for both the term **Architecture**and **Architectural planning** as well as **A: planning department** etc.
> * For a variable that is to be queried only in the situation (planning phase) Architecture, the condition is then: **(V\_VarSit={A\*})**.
> * For a variable that is to be queried only in the situations (planning phase) Architecture and Construction, the condition is then: **(V\_VarSit={A\*\~K\*})**.
> * Example of dependence on another variable: The enum **V\_Option** has the options *fixed* and *free*. The variable **V\_Value** is to be queried only when the option *free* has been selected. The variable condition is then **(V\_Option=free)**. Only in this case is it **V\_Value** visible; otherwise it is hidden.
>
> Variables whose identifier U (invisible) is set are never queried; therefore the condition only applies to variables for which U is not set.
>
> If the variable **V\_VarSit** has not been set in the default values, then all conditions would be false and no conditional variables would be displayed. In this case, the system sets the variable **V\_VarSit** to "**S**" for "Standard". This can be used as follows:
>
> * To ensure that all conditional variables are displayed in the case **V\_VarSit=S** it is advisable to include the "S" in the selection. For a variable that normally is to be queried only in the input situation Architecture, the condition is then: **(V\_VarSit={A\*\~S\*})**. For a variable that is to be queried only in the input situations Architecture and Construction, the condition is then: **(V\_VarSit={A\*\~K\*\~S\*})**.
>
> (24.01) In the combined elements of openings (windows, doors, recesses), the intermediate values of the first combined element of the opening can also be used in the conditions. This allows complex determination of the display conditions for the variable.

**Further values:**\
This list is only active for enumerations. Here, the individual options of the enumeration can be written one below the other in a list. The first value in the list is automatically the suggested value. In the list input of variables, the options of the enumeration are displayed separated by semicolons in the suggested value, or can also be entered in this way.

**Variable description:**\
Additional long text for describing the variable. This is displayed both in the variable query and in the selection of the variable in the formula editor.

### Possible units for variables:

Separator When querying the variables, the variable query appears here as a heading for which no values are entered. This is very important to ensure clarity when there are many variables. A suggested value must be entered in the variable definition; this has no further meaning and can, for example, be 0.

Number This unit is used for integer values, especially for the quantity of elements.

m, cm, mm, in, ft: length units for meters, centimeters, millimeters, inches, and feet.

° angle specification in degrees; a full circle has 360°

A-B specification of reference sides A or B (end face at the beginning or end). Can only be used in point symbols.

C-F specification of reference sides C to F (long sides only). Can only be used in point symbols.

A-F specification of reference sides A to F (end faces and long sides). Can only be used in point symbols.

txt text.

Y/N query with answer yes or no.

Enum enumeration: list of texts for freely definable options. The texts are offered in a drop-down list during the variable query. The first value in the list is used as the suggested value. For easier input, the 'Variable Definition' dialog should be used. Enumerations are often used in conditions. However, they can also be used in texts.

ID no. identification number for connectors. During the variable query, the identification browser of the component catalog can be opened. Only identification numbers for connectors are offered for selection. This is used particularly in point symbols.

(V21.01):

IdVbVgs identification number for connectors with structural component type = fully threaded screw. Only identification numbers for connectors with this structural component type are offered for selection.

IdVbPbo identification number for connectors with structural component type = machine screw (= dowel bolt). Only identification numbers for connectors with this structural component type are offered for selection.

IdVbSdu identification number for connectors with structural component type = rod dowel. Only identification numbers for connectors with this structural component type are offered for selection.

IdVbNag identification number for connectors with structural component type = nail. Only identification numbers for connectors with this structural component type are offered for selection.

IdVbSna identification number for connectors with structural component type = special nail. Only identification numbers for connectors with this structural component type are offered for selection.

IdVbDbb identification number for connectors with structural component type = dowel, special design. Only identification numbers for connectors with this structural component type are offered for selection.

IdVbKla identification number for connectors with structural component type = staple. Only identification numbers for connectors with this structural component type are offered for selection.

IdVbGst identification number for connectors with structural component type = threaded rod. Only identification numbers for connectors with this structural component type are offered for selection.

IdnrO identification number without profile for transfer to components and library elements. During the variable query, the identification browser of the component catalog can be opened. Only identification numbers of the component types rod, plate, formed part, or auxiliary component without profile description are offered for selection. For transferring identification numbers to library parts, this unit should be preferred, since an identification number with profile description cannot be selected by mistake; such a number could not be applied to the library parts.

IdnrB identification number for components for transfer to components. During the variable query, the identification browser of the component catalog can be opened. Identification numbers of the component types rod, profile rod, plate, formed part, or auxiliary component with or without profile description are offered for selection.

IdnrF identification number for transfer to windows. During the variable query, the identification browser of the component catalog can be opened. Identification numbers of the component type *window* are offered.

IdnrT identification number for transfer to doors. During the variable query, the identification browser of the component catalog can be opened. Identification numbers of the component type *door* are offered.

Rod type. Can only be used in point symbols.

W/M identifier for delivery location workshop or assembly. Can only be used for connectors in point symbols.

Texture set texture set for transfer to components and library elements. During the variable query, the texture browser can be opened.

ZColorTexture additional color texture set for transfer to components and library elements. During the variable query, the color browser can be opened.

### Variables: reference images

Reference images are used for explanation during variable queries.

* Possible formats for reference images are: **\*.bmp, \*.png, \*.wmf, \*.emf, \*.jpg**.
* The standard size for reference images is approximately 340 x 340 pixels (previously approximately 300 x 300 pixels). If the reference image is larger, it is reduced to this size. To save disk space, larger images (e.g., photos) should therefore be reduced to an appropriate size with suitable software (e.g., IView).
* Dietrich's supplies a large number of reference images for various purposes. These are all located in the system directory for reference images **%dhpabb%**, e.g. **C:\Dietrichs12\abb**. These images are generally available to every user with the current version. If files are passed on that refer to these reference images, the images themselves do not need to be copied. Therefore, in variable sets and default values, not these images are stored, but only a reference to these images.
* In variable sets, only the reference to the reference image is stored if the reference image is located in a subdirectory of **%dhpabb%**  . If the reference image is selected from another directory, it is stored in the variable set. When the variable set is passed on, the reference images are then included as well.
* In point symbols, only the reference to the reference image is stored, not the reference image itself. When passing them on, the reference images that are not located in **%dhpabb%** must also be copied.
* In combined elements, only the reference to the reference image is stored, not the reference image itself. When passing them on, the reference images that are not located in **%dhpabb%** must also be copied.
* In HRB files, the reference image itself is stored. When the HRB file is passed on, all reference images are included as well.
* In default values in the project, structure, and profile, only the reference to the reference image is stored if the reference image is located in a subdirectory of **%dhpabb%**  . If the reference image is selected from another directory, it is stored in the default values. When the project or files are passed on, the reference images are then included as well.

### Saving variables in variable sets

A collection of variables can be saved like other settings using the standard procedure. After that, it is possible in every variable definition to adopt the entire variable set or individual variables.

Individual variables are adopted via the browser button directly next to the variable name. Entire variable sets are offered like other settings in the selection above the variable definition.

* If stored variables are adopted, it is ensured that the variable always has the same name.
* Description texts and reference images for documenting the variable are then available without re-entry.
* The stored variables can be used equally in default values, point symbols, combined elements, and HRB files. For default values, they are available in projects, structures, and profiles.
* When entire variable sets are adopted, you can optionally:\\
* add only new variables,\\
* overwrite existing ones and add new ones\\
* or remove excess ones, overwrite existing ones, and add new ones.

### Support functions for entering variables

#### Variable search

(V20.01) When creating and editing formulas, it often happens that the definition of a variable or intermediate value must be searched for. In all dialogs for defining variables and intermediate values (default values, point symbols, combined elements, HRB editor), there is now a function for searching variables or intermediate values. This is called via the corresponding button, and you enter the search term:

* The exact text (e.g. **V\_abc123**) or, with wildcards, a text fragment, e.g. **V\_A\*** for all variables that start with **V\_A** , **\*abc\*** for all that contain abc.
* The function searches both in the variable names and in the variable query. Therefore, you can also search for the displayed text if you do not know the variable name.
* If you start the function again and enter a new search text, the search automatically starts at the beginning of the variable list.
* With the "next" button, the last used search text is searched for, and the view jumps from the current position to the next location containing the text.

#### Variable editor file

(V20.01) Variable editor file: For editing intermediate values, it has proven useful to externalize them into a text file and edit them with a standard text editor. There, many helpful functions such as search, replace, copy, etc. are available. Now, in all dialogs for variable definition (default values, point symbols, combined elements, and HRB editor), variables can also be exported to and re-imported from a text file. The files are located, as for intermediate values, in **%DHPTMP%** (e.g. **C:\Dietrichs19\wintmp**) and the file names are **VAEditor.txt** or **VAEditorHRB.txt**.

#### log files for variables and intermediate values

When executing combined elements, in HRB allocation, and when working in the HRB editor, we can generate log files. These contain a listing of the variables and intermediate values with their associated values in the respective situation. The log files are created in the directory **%DHPTMP%** (e.g. **c:\Dietrichs20\wintmp**). They are extremely helpful for checking, but these files are not necessary for using the combined elements and HRB files. (V20.01) The creation is controlled in project management in the function "*5-02-1 protocol functions*" via the checkbox "*generate log files for variables"* If it is selected, the log files are created. By default, the checkbox is not selected, and the files are not created; this saves time during execution.
