In this article the following contents will be covered:
Variables
Variables are used in formulas to help customize Promob. Variables are values that change according to the scenario, thus allowing the system's library rules to be configured more easily. If the values used in references or aggregate registration, for example, were always fixed, every time one of the factors changed, the whole library would be misconfigured. Therefore, the use of variables is important for Promob's library.
Below are the variables in the Promob Catalog:
Variable |
Function |
$PW$ |
Parent width |
$PH$ |
Parent height |
$PD$ |
Parent depth |
$W$ |
Aggregate width |
$H$ |
Aggregate height |
$D$ |
Aggregate depth |
$UW$ | Aggregate width in the Promob unit of measure |
$UH$ | Height of the aggregate in the Promob unit of measure |
$UD$ | Depth of aggregate in the Promob unit of measure |
$InsertWidth$ |
Insertion Width |
$InsertHeight$ |
Insertion Height |
$InsertDepth$ |
Insertion Depth |
$A.Max.X$ ou $A.Min.X$ |
Maximum or minimum X position in the environment |
$A.Max.Y$ ou $A.Min.Y$ |
Maximum or minimum Y position in the environment |
$A.Max.Z$ ou $A.Min.Z$ |
Maximum or minimum Z position in the environment |
$MaxWidth$ ou $MinWidth$ |
Returns the maximum or minimum width for insertion |
$MaxHeigth$ ou $MinHeigth$ |
Returns the maximum or minimum height for insertion |
$MaxDepth$ ou $MinDepth$ |
Returns the maximum or minimum depth for insertion |
$N$ |
Total numbers of repetitions |
$NI$ |
Item position on repeat |
$I$ |
Value 1 when the module is inverted, value 0 when it is not |
$CW$ |
Value 1 when changing the width measurement, value 0 when not changing |
$CH$ |
Value 1 when changing the height measurement, value 0 when not chaning |
$CD$ |
When you changed any measure |
$CP$ |
When you changed the depth measurement |
$X$ |
Returns the item's X |
$Y$ |
Returns the item's Y |
$Z$ |
Returns the item's Z |
$PZ$ |
Returns the missing value from the module to the floor |
$PositionService$ |
Returns the description of the option used by any child who has a positioning service |
$ParentWallHeight$ |
Parent wall height value, if the is no parent wall, it returns the maximum limit of the room height |
$HasChildren(id_entidade)$ |
Returns whether there is a child entity (identity_id) ( true or false) |
Round(valor) |
Returns the rounded value up or down depending on what is closets to the number entered in parentheses |
Ceil(valor) |
Returns the rounding up of the number entered in parentheses |
Floor(valor) |
Returns rounding down the number entered in parentheses |
IMPORTANT: the addition of P. or Parent. Raises the level where information is sought. Example:
- $ P.P.W $ returns the width of the item's parent's parent.
- $ P.P.H $ returns the height of the parent of the item's parent.
- $ P.P.D $ returns the depth of the item's parent's parent.
Operators
Operators are symbols that can be used in assembling references and calculating the position and dimensions of aggregates.
Below is a table with a list of operators for use in the Promob Catalog:
Operator |
Function |
Example |
VAR1 + VAR2 |
Addition: VAR1 plus VAR2 |
$PW$ + 50 |
VAR1 - VAR2 |
Subtraction: VAR1 subtracted from VAR2 |
$PD$ - $D$ |
VAR1 * VAR2 |
Multiplication: VAR1 multiplied by VAR2 |
$PH$*2 |
VAR1 / VAR2 |
Division: VAR1 divided by VAR2 |
$PW$/2 |
VAR1 < VAR2 |
Less than: VAR1 less than VAR2 |
$PW$ < 400 |
VAR1 > VAR2 |
Greater than: VAR1 greater than VAR2 |
$PW$ > 800 |
VAR1 <= VAR2 | Less than or equal to: VAR1 less than or equal to VAR2 | $PW$ <=1000 |
VAR1 >= VAR2 | Greater than or equal to: VAR1 greater than or equal to VAR2 | $PW$ >= 200 |
VAR1 == VAR2 | Equal: VAR1 equals VAR2 | $PH$ == 400 |
VAR1 ! = VAR2 |
Different from: VAR1 different from VAR2 |
$PD$ !=550 |
!VAR1 |
Denial: not VAR1 |
!($PD$ == 500) |
VAR1 && VAR2 |
Logical 'AND': VAR1 and VAR2 |
$PW$ > 200 && $PW$ < 800 |
VAR1 | | VAR2 |
Logical 'OR': VAR1 or VAR2 |
$PH$ == 200 || $PH$ == 400 |
Formulas
Formulas are used to configure positioning, dimensions and repetition of aggregates, in addition to being used also for the registration of references, removal options, visibility conditions, etc.
Below are some of the most used formulas:
Formulas to centralize aggregate:
Formula |
Function |
Example |
$PW$/2-$W$/2 |
Center aggregate in width |
Module width divided by 2 minus the aggregate widht divided by 2. |
$PH$/2-$H$/2 |
Center aggregate at height |
Module height divided by 2 minusthe height of the aggregate divided by 2. |
$PD$/2-$D$/2 |
Center aggregate in depth |
Module depth divided by 2 minus the depth of the aggregate divided by 2. |
Formulas to align aggregate:
Formula |
Function |
Example |
$PW$ - $W$ |
Aligns aggregate to te right of the module. |
Module width minus aggregate width. |
$PH$ - $H$ |
Aligns aggregate to the top of the module. |
Module height minus aggregate height. |
- $PD$ + $D$ |
Aligns the front of the unit to the front of the module. |
Less module depth plus aggregate depth. |
IMPORTANT: These quoted formulas for aligning and centering apply to aggregates that have the zero point located at the bottom left rear corner of the drawing.
For cases where this rule does not apply, it is necessary to develop specific formulas for this.
The values that must be changed in the formulas detailed below are only VAR1 and VAR2.
Formulas for repeating aggregates:
With fixed distance: The distance must be fixed because the size of the spans is independent of the amount of repeated aggregates, always being the same.
Formula |
Function |
Axis X: VAR1 + {($W$+VAR2}*($NI$-1)} |
Where VAR1 is the distance value before starting the repetition (from left to right) and VAR2 is the distance value after the repetition. |
Axis Y: VAR1 + {($D$+VAR2)*($NI$-1)} |
Where VAR1 is the distance value before starting the repetition (backwards) and VAR2 is the distance value after the repetition. |
Axis Z: VAR1+{($H$+VAR2)*($NI$-1)} |
Where VAR1 is the distance value before starting the repetition (bottom to top) and VAR2 is the distance value after the repetition. |
With variable distance: The distance must be variable because, according to the amount of repeated aggregates, the size of the spans changes (increases or decreases) and stays with the same size of all spans.
Formula |
Function |
Asix X: $N$ == 1 ? $PW$/2 - $W$/2: ((($PW$ - (2*VAR1) - ($W$ * $N$))/($N$+1)) * $NI$) + VAR1 + ($NI$ > 1 ? ($NI$ - 1) * $W$ : 0 ) |
Where VAR1 should be replaced by the thickness of the side. |
Asix Y: $N$ == 1 ? -($PD$/2 - $D$/2 + (VAR1 + VAR2)/2) : - (((($PD$ - (VAR1 + VAR2) - ($D$ * $N$))/($N$ + 1)) * $NI$) + (VAR1 + VAR2) + ($NI$ > 1 ? ($NI$ - 1) * $D$: 0)) |
Where VAR1 should be replaced by the thickness ofthe bottom side and VAR2 by the back retreat. |
Asix Z: $N$ == 1 ? $PH$/2 - $H$/2 + VAR2/2 : ((($PH$ - VAR2 - (2 * VAR1) - ($H$ * $N$))/($N$ + 1)) * $NI$) + VAR2 + VAR1 + ($NI$ > 1 ? ($NI$ - 1) * $H$ : 0 ) |
Where VAR1 should be replaced by the thickness of the base and VAR2, by the height of the toe kick. |
General formulas:
Formula |
Function |
@(VAR1 > VAR2 ? VAR3 : VAR4) |
The @ causes the expression between parentheses to return only the final value: ? means THEN : means IF NOT Thus, it reads: if VAR1 is greater than VAR2, then VAR3. If not, VAR4. |
VAR1 > VAR2 && VAR1 <VAR3 |
Tests whether one value is greater than another and less than a third value. |
'%CHECKED(VAR1.VAR2)%' = = 'True' ? 'VAR3' : 'VAR4' |
Tests wheter an aggregate is in the environment and performsan action,with VAR1 equal to the Module ID (aggregate) field and VAR2 equal to the Aggregate ID field. It reads: if the aggregate of module ID X and ID Aggregate Y is active (True) , then (?) Returns VAR3, if not (:) returns VAR4. |
$A.Max.Z$ - ($PH$+$PZ$) |
Tests if an aggregate is in the environment and performs a Returns the missing value of the module at the end of the wall. It reads: Maximum height of the wall minus (height of the module plus the position on the wall) |
To set up tests one can follow the examples below:
Example 1:
@($PD$ = 500 ? 500 : $PD$-50)
Where it reads:
IF $PD$ = 500 THEN 500 IF NOT $PD$-50.
@ - The at sign causes the expression in parentheses to return only the final value.
? - It is the THEN of the formula.
: - It is the IF NOT of the formula
The above example can be enhanced to more complex formulas such as:
Example 2:
@($PD$ = 500 ? 500 : @($PD$ = 600 ? 550 : $PD$-50))
In the example, right after the IF NOT, another test will be performed.
Example 3:
($PD$ 500) && ($PW$ = 600)
In the example, the symbol && means AND, that is, both situations must be true.
Example 4:
($PD$ 500) || ($PW$ = 600)
In the example, the symbol || means OR, that is, only one of the situations must be true.