For the formulas examples will be used an element
with the following properties:
- Element: Wall
- Family: Basic Wall
- Type: Exterior Wall - 300
- Width: 0.30
- Layers
- Wood - 0.05 m
- Concrete - 0.25 m
// Formulas always starts with the "=" sign
= startswith({Type};"Ext")
// Text inside formulas must be encapsulated by ""
= "A"
//If outside, can use without ""
A
{Type}
Exterior Wall - 300
= "Wall of type " & {Type}
Wall of type Exterior Wall - 300
= 1+1
2
= 4/2
2
= 3*3
9
= 2-1
1
= ({width} + 1) * 3
3.9
= contains({Type};"xte")
True
= startswith({Type};"Int")
False
= endswith({Type};"300")
True
= and(startswith({Type};"Ext"); endswith({Type};"300")) //can be addded more logic tests separated by ;
True
= or(startswith({Type};"Ext");startswith({Type};"Int")) //can be addded more logic tests separated by ;
True
= not(startswith({Type};"Int"))
True
= hasparameter(“Type”)
True
= 1=1 //Equal
True
= 2<>2 //Not equal
False
= 2 >= 1
True
= 2 <= 1
False
= 2 > 2
False
= 2 < 3
True
// if(Logic__Test; Value_True; Value_False)
= if({Type}="Exterior Wall - 300"; true; false)
true
= if({Type}="Interior Wall - 300"; "A"; "B")
B
// Parameter xpto does not exists, a error will be thrown
// and get catch, returning "A"
= if.error({xpto}="Exterior Wall - 300"; "A")
A
// Describes compound structures, such as walls and floors,
layer by layer with custom description by layer
= layers({Material: Name} & " with " & {Layer-Width} & " m"; "+
") //break line to have one layer per line
Wood with 0.05 m +
Concrete with 0.25 m
¶ Length, Left and Right
= {Family}
Basic Wall
// Get Length of Text
= length({Family})
10
// Get Text Left
= left({Family};3)
Bas
// Get Text Right
= right({Family};3)
all
¶ Maximum and Minimum
= max(1;3;{Width})
3
= min({Width};1;3;5)
0.3
= format("There are {0} balls and {1} rackets", 3, 5)
There are 3 balls and 5 rackets
= format("Width: {0:N2} m", {Width})
Width: 0.30 m
= format("Width: {0:N1} cm", {Width}*1000)
Width: 30.1 cm
Character |
Description |
Usage |
Example |
c |
Currency |
|
$ 55,674.74 |
e |
Scientific |
|
5.567474e+004 |
f |
Fixed point |
|
55674.74 |
g |
General |
|
55674.73789621 |
n |
Thousand Separator |
|
55,674.74 |
Character |
Description |
Usage |
Example |
0 |
Zero Placeholder |
|
55674.74 |
# |
Digit Placeholder |
|
(55674).74 |
. |
Decimal Point |
|
55674.738 |
, |
Thousand Separator |
|
55,675 |
% |
Percent |
|
5567474% |