This functionality is only available for certain module packages.

You are here: EEC > BASE > Basic workflows > Parameterizing of library components > Parameterization with formulas

Parameterization with formulas

The use of formulas in library components allows for variants of components in the project to be calculated automatically.

The formula is created directly in the parameter editor, in the Value column. When creating extensive formulas, it is recommended that the Formula Editor view and / or modal formula editor be used. The Formula Editor supports the user through syntax highlighting and Content Assistant.

In the modal formula editor, use the key combination Ctrl + F or the context menu (Find/Replace) to call up the function Find/Replace.

Using the key combination [Ctrl] + [Z], the last entry can be undone (UNDO), and restored (REDO) using the key combination [Ctrl] + [Y].

Related bracket pairs for the bracket types [ ], { } und ( ) are highlighted in the formula editor.

In the formula editor, the cursor must be positioned after an opening or closing bracket in order to highlight the opposite bracket with a frame (see figure below)

The components of the Room type to be inserted for an IT_SolutionMap in the tutorial model are marked in the diagram with the value of tooltip that consists of various parameter values. It is a combination of parameter values for the floor number (Number), which itself is calculated by way of a formula, and the value for the room type (Type), as well as a hyphen. The room type is selected from a list of room types during the interactive creation of the diagram. The tooltip is assembled according to the following syntax: <floor number> + '. ' + <running room number> + '- ' + <room type>

The above figure shows the nomenclature of the rooms of a floor in the diagram.

The values for the parameters Number and Tooltip are calculated on the library component. The formula is inserted in the parameter editor of the library object:

Number is determined from the eponymous parameter of the superordinate component (mc.$Number), a period (+ ‘.’ +) and the running number of the room component in the project (mc.mos(‘IT_ModularSystem.Buildingcomponents.Room’).indexOf(this)+1).

Since the formula is to apply to all objects, it is entered in the Value field. Thus, the value for Number is calculated automatically when adding a room to a floor .

The full formula is thus: =mc.$Number + '.' + (mc.mos('IT_ModularSystem.Buildingcomponents.Room').indexOf(this)+1)

Tooltip is ultimately composed of the calculated value of the Number parameter, a hyphen, and the given value for the Type parameter, with the strings being linked together.

The formula for this is as follows: =$Number + '-'+ $Type

The formula results are as follows in the project component Room:

For the project component Room, the parameter value A 4.1 is calculated for Number.

At the time the diagram was created, the parameter value selected for Type was Office.

For the Tooltip parameter value, this results in A 4.1 - Office.