AttributeExpression Property |
Having the expression defined, attribute gets dynamic in nature. Expression parser takes in account unlimited number of both mathematical and logical expressions (finite state machine), accompanied with specialized functions represented by their keywords and attribute Names. Keep in mind that Names and function identifiers are mutually exclusive.
When evaluating other attribute's value, expression parser takes in account other possibly referenced attribute values (as a list of pointers to other attributes). Whitespaces in expression string are optional.See remarks section for detailed description and examples.
Namespace: FDF.Common.ObjectModel
Expression examples:
Expression | Description |
---|---|
area | Returns the area represented by Element geometry. If geometry cannot get calculated or is 1-dimensional (e.g. Point), result is 0. |
AttributeName1+10 | Where AttributeName1 represents named instance of an Attribute object within present Element structure. This expression equals to calculated value of AttributeName1 increased by 10. It's important not to mix data types as results might get unpredictable. Attribute and function identifiers found within expression string are case sensitive. |
length+(AttributeName2*3/100)+AttributeName3 | A bit more complex expression taking in account two other instances of Attributes. It calculates length of Element geometry, then adds 3% of evaluated AttributeName2, adding AttributeName3 value to the final score. |
if(length>100,AttributeName2,AttributeName3) | Represents conditional branching depending on Element's geometric length. |
The following table lists function keywords used by expression parser:
Identifier | Function identifier description |
---|---|
abs | Absolute value (abs(x)) function. |
acos | Calculates the angle whose cosine is the specified number. |
asin | Calculates the angle whose sine is the specified number. |
atan | Calculates the angle whose tangent is the specified number. |
floor | Returns the largest whole number less than or equal to the specified number. |
ceiling | Returns the largest whole number greater than or equal to the specified number. |
exp | Returns e raised to the specified power. |
sin | Returns the sine of the specified angle. |
sinh | Returns the hyperbolic sine of the specified angle. |
sqrt | Calculates the square root of the specified number. |
cos | Returns the cosine of the specified angle. |
cosh | Returns the hyperbolic cosine of the specified angle. |
if | Enables if(condition, then,else) conditional branching. |
max | Returns the maximum value among provided parameters. |
min | Returns the minimum value among supplied values. |
round | Rouding of a number to the nearest whole number. |
sign | Returns a value that indicates the sign of the provide value. Returns the following possibilties: value less than 0 = -1; value equals to 0 = 0; value greater than 0 = 1 |
tan | Returns the tagent of the supplied angle. |
tanh | Returns the hyperbolic tangent of the supplied angle. |
log | Returns the logarithm of a specified number. |
log10 | Returns the base 10 logarithm of a specified number. |
area | Returns the area of given Element geometry. |
length | Returns either length or perimeter for given Element geometry. |
elevation | Returns elevation (Z axis) for given Element geometry. |