Click or drag to resize
AttributeExpression Property
Gets or sets mathematical or logical expression being evaluated at run-time.

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
Assembly: FDF.Common (in FDF.Common.dll) Version: 3.0.0.0
Syntax
public string Expression { get; set; }

Property Value

Type: String
Remarks
Any identifiers found within expression string are case sensitive.

Expression examples:

ExpressionDescription
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:

IdentifierFunction identifier description
absAbsolute value (abs(x)) function.
acosCalculates the angle whose cosine is the specified number.
asinCalculates the angle whose sine is the specified number.
atanCalculates the angle whose tangent is the specified number.
floorReturns the largest whole number less than or equal to the specified number.
ceilingReturns the largest whole number greater than or equal to the specified number.
expReturns e raised to the specified power.
sinReturns the sine of the specified angle.
sinhReturns the hyperbolic sine of the specified angle.
sqrtCalculates the square root of the specified number.
cosReturns the cosine of the specified angle.
coshReturns the hyperbolic cosine of the specified angle.
ifEnables if(condition, then,else) conditional branching.
maxReturns the maximum value among provided parameters.
minReturns the minimum value among supplied values.
roundRouding of a number to the nearest whole number.
signReturns 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
tanReturns the tagent of the supplied angle.
tanhReturns the hyperbolic tangent of the supplied angle.
logReturns the logarithm of a specified number.
log10Returns the base 10 logarithm of a specified number.
areaReturns the area of given Element geometry.
lengthReturns either length or perimeter for given Element geometry.
elevationReturns elevation (Z axis) for given Element geometry.

See Also