Formulas, arithmetic functions and operators

Tool(s): Label Style, defining formula + Define Cell, formula

Arithmetic operators

+

Addition

()

Brackets

-

Subtraction

(())

Nested brackets

*

Multiplication

e

A power of e for floating point representation

/

Division

^

Power

Supported arithmetic functions

Note: The arithmetic functions that can be used in conjunction with label styles differ from those provided in the Function () tool (Advanced Draft module). Click here to see an overview.

Allplan

Function

Description

ABS(X)

|x|

Modulus

SQR(X)
SQRT(X)

 

Square root

PI(X)

PI

Circle function of pi PHI(2) = PI * 2

LN(X)

kn x

Natural logarithm

LOG(X)

log x

Logarithm to the basis 10

RCP(X)

1/x

Reciprocal of x

EXP(X)

ex

Exponential function (basis x)

SGN(X)

-

Sign 0=0 <0=-1 >0=+1

SIN(X)

sin x

Sine

COS(X)

cos x

Cosine

TAN(X)

tan x

Tangent

ASIN(X)

arcsin x

Arc sine

ACOS(X)

arccos x

Arc cosine

ATAN(X)

arctan x

Arc tangent

SINH(X)

sinh x

Hyperbolic sine

COSH(X)

cosh x

Hyperbolic cosine

TANH(X)

tanh x

Hyperbolic tangent

NINT(X)

-

Rounds off to nearest integer

INT(X)

-

Rounds down to nearest integer

CEIL(X)

-

Rounds up to nearest integer

GRA(X)

-

Radians to degrees

RAD(X)

 

Degrees to radians

GON(X)

-

Radians to grads

RAG(X)

 

Grads to radians

AVG(x1; x2; ..)

-

Returns the average of up to 10 semicolon-separated arguments (AVG(1;3)=2)

MIN(x1; x2; ..)

-

Returns the minimum of up to 10 semicolon-separated arguments (MIN(1;3)=1)

MAX(x1; x2; ..)

-

Returns the maximum of up to 10 semicolon-separated arguments (MAX(1;3)=3)

FLAG(Value; bit[n];...)

-

Binary analysis
For example:
Value = 25 --> binary: 11001

FLAG(Value; 1) returns 1 because the first flag from the right is set.
FLAG(Value; 2; 3) returns 0 because neither the second flag nor the third flag from the right is set.
FLAG(Value; 3; 4) returns 8 because the fourth flag is set.

ROUND(X;x)

-

Rounds off to a certain number of digits
(ROUND(1.13333;2)=1.13)

ROUND(X;y;z)

-

Rounds off any number (x) to a certain number of digits (y). You can specify a round-off value for the last digit (z)
(ROUND(1.13333;2.5)=1.15)

ELE()

-

Filters several numerical values of an attribute and returns 0 or 1
For example:
ELE(thickness;0,115;0,24;0,365)
Detects all walls of the thickness specified

VALUE(string;index)

-

As in Excel:
Derives any information from text
For example:
STR_TEST = "There are 6 rooms and 2 bathrooms in my house"
VALUE(STR_TEST;1) + VALUE(STR_TEST;2) = 8

MID(Text;
first_character;
number_of_characters)

-

As in Excel:
Returns a specific number of characters of a character string

FORMAT(format string; value1; [value<n>]; ....)

-

Returns formatted values
For example:
FORMAT("W/H=%.2f / %.2f"; @220@; @222@)
returns a string
"W/H=1.55 / 2.03"

%.2f is a placeholder that rounds off the value to two decimal places. In this example, the length (@220@) is inserted in the first placeholder and the height (@222@) in the second placeholder with two decimal places each.



(C) Allplan GmbH Privacy policy