Contextual Functions & Variables

Certain Functions and Variables are only present in particular parts of the application which are detailed below.

Calculated Fields

Table Plots: Data Functions

Custom Fields: Source Percentage Completed

 

Calculated Fields

Node Functions

Node Functions (GetChild, GetFirstChild, GetLastChild, GetNextSibling, GetParent, GetPreviousSibling) extend the GetValue and GetText functions to look at records other than the current node (for which the code name is CurrentNode).

A "Sibling" is a Node that is at the same Level, a "Parent" is a Node above and a "Child" is a Node below. "Previous" refers to an earlier Index and "Next" refers to a later one. There are several key points to note when using these Node Functions.

  1. A GetValue(Field, Node) can return a Value at a higher level than the leaf. When this is the case, for example:
    GetValue(ImportedVolume,GetParent())
    then an aggregation must be set on the Field called in order to return a value.
  2. You can stack several Node Functions together to move around your Table. See the image below for some examples.
  3. It is possible for a Node Function to return a "null" result. For example:
    GetPreviousSibling(GetFirstChild())
    will return a "null" or empty result which cannot produce a value. There are two ways to manage this: Either don't prepare for it (default) which will produce an error on your Field rather than a result. The second option is to ignore the error using the SkipErrors boolean overload and the ValueIfError overload for the GetValue. For example:
    GetValue(ImportedVolume,GetPreviousSibling(CurrentNode,True),999)

Contextual Functions & Variables (Top)

Design Element Functions

Design Element functions can be used to retrieve the properties of design elements. These functions take a (shape or triangulation) design element as input and return the associated value (provided the types match).

Design element (shape only) functions:

GetShapeLength(CurrentElement)
GetShapeArea(CurrentElement) 
GetShapeCentroid(CurrentElement)
GetShapeAverageZ(CurrentElement)
GetShapeMinGradient(CurrentElement)
GetShapeMaxGradient(CurrentElement)
GetShapeAzimuth(CurrentElement)
GetShapeMinXYZ(CurrentElement)
GetShapeMaxXYZ(CurrentElement)

Design element (layer triangulation) functions:

GetShapeVolume(CurrentElement)
GetShapeMinXYZ(CurrentElement)
GetShapeMaxXYZ(CurrentElement)

For example:

If(GetShapeArea(CurrentElement) > 15000,True,False)

or

GetZCoordinate(GetShapeMaxXYZ(CurrentElement))

to assign the max Z to an attribute as shown below:

Solids Functions

Solid Field functions can be used to retrieve the properties of calculated and non-calculated solid fields. For example:

GetSolidMaxXYZ(Field)

Solid field functions:

GetSolidCentroid(Field)
GetSolidMinXYZ(Field)
GetSolidMaxXYZ(Field)
GetSolidVolume(Field)
GetSolidAreaofHull(Field)
GetSolidAreaofTriangles(Field, DipDegrees)
GetSolidThickness(Field)
GetSolidThickness(Field, GridXCount)
GetSolidThickness(Field, GridXCount, UseTopQuarter)

Contextual Functions & Variables (Top)

Table Plots: Data Functions

(NodesSum, NodesWeightAvg, NodesMin, NodesMax)

Because Table Plots often rely on groups of Leaves to provided aggregated results (e.g. Strip Ratios are a combination of all Waste divided by all Coal in a vertical group of Leaves) GetValue type Functions needs to be wrapped in a Nodes Function to correctly aggregate the results. This is because there will be examples where you want NodesSum(e.g Strip Ratios), NodesWeightAvg (e.g Quality Plots) and NodesMin/Max (e.g. Period Progress Plots).

Custom Fields: Source Percentage Completed

When creating Custom Fields, it's important that Value Custom Fields that are Aggregated by Sum are also multiplied by the SourcePercentageCompleted variable to ensure they are not over-represented.

SourcePercentageCompleted and other "Common Value" variables can be easily inserted into an expression. For more information, see: Options

Contextual Functions & Variables (Top)