Field-Map Scripting Events

  1. Attribute events

    1. OnChange

Launched by attribute value change. New value of attribute can be used for further data processing.

    1. OnValidate

Attribute data validation script can be attached to this event. OnValidate event is launched before attribute value changed, new value can be rejected.

In order to reject new value the property ScriptResult is set to 0 (otherwise I set to 1). Additionally the ValidationFailedMessageText can be defined.

Example

if …testing condition… then begin
  ScriptResult := 0;
  ValidationFailedMessageText := 'Invalid value.';
end;

  1. Layer events

    1. BeforeCancel

    Applicable to: all layer types
    1. AfterCancel

    Applicable to: all layer types
    1. BeforeDelete

    Applicable to: all layer types
    1. AfterDelete

    Applicable to: all layer types
    1. BeforeEdit

    Applicable to: all layer types
    1. AfterEdit

    Applicable to: all layer types
    1. BeforeInsert

    Applicable to: all layer types
    1. AfterInsert

    Applicable to: all layer types
    1. BeforePost

    Applicable to: all layer types
    1. AfterPost

    Applicable to: all layer types
    1. BeforeScroll

    Applicable to: all layer types
    1. AfterScroll

    Applicable to: all layer types
    1. AfterDeletePlot

    Applicable to layer: plots,
    1. BeforeBuildPolygons

    Applicable to layer: plots,polygons,
    Output variables (pass value from script to FM):
    SafeCleanLinesAfterPolygonization
    =0 do not save; 1=prompt for saving 2=save without asking
    ConsiderSelectedCentroids
    =0 do not consider; 1=prompt for considering 2=consider without asking
    CentroidSelectionFilter
    WHERE clause of SQL script for selection of centroids for polygonization eg. AttributeX=23
    ConsiderSelectedLines (since version X7)
    =0 do not consider; 1=prompt for considering 2=consider without asking
    LineSelectionFilter (since version X7)
    WHERE clause of SQL script for selection of lines by layers eg. Lines:ID IN (1,5,15)|Lines2:AttributeX>23
    PolygonizationExtent (since version X8)
    1-FULL 2-FULL and disabled 3-EXTENT 4-EXTENT and disabled}
    IncrementalPolygonization
    =0 do not consider; 1=TRUE 2=TRUE and disabled 3-FALSE and disabled
    SkipPolygonizationLayerDialog
    =0 show by default; 1=do not show dialog (OK)
    BackupPriorPolygonization
    =0 show by default; 1=do not show dialog and BACKUP; 2=do not show dialog and NO BACKUP
    RunPolygonizationWizard
    =0 NO by default; 1=YES
    HidePolyshapeButtons (since version X8)
    list of button names to be hidden; separated by semicolon
    1. AfterBuildPolygons

    Applicable to layer: plots,polygons,
    1. OnCreateNewID (since version X8)

    Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
    Input variables (pass value from FM to script):
    NewPoint_X
    valid only for point/tree layers
    NewPoint_Y
    valid only for point/tree layers
    NewID
    automatically created new ID is being sent to the script for revision
    Output variables (pass value from script to FM):
    NewID
    new ID can be set up in the script; responsibility of ID validity is on the user
    1. BeforeNewPoint (since version X8)

    Applicable to layer: points, polygons, trees,
    Input variables (pass value from FM to script):
    NewPoint_X
    NewPoint_Y
    1. AfterNewPoint

    Applicable to layer: points, polygons, trees,
    Input variables (pass value from FM to script):
    NewPoint_X
    NewPoint_Y
    Vector_PenMapping
    =0 for pen mapping; NULL otherwise
    1. BeforeMovePoint

    Applicable to layer: points, polygons, trees,
    Input variables (pass value from FM to script):
    MovePoint_OldX (since version X8)
    MovePoint_OldY (since version X8)
    1. OnMovePoint (since version X8)

    Applicable to layer: points, polygons, trees,
    Input variables (pass value from FM to script):
    MovePoint_OldX
    MovePoint_OldY
    MovePoint_NewX
    MovePoint_NewY
    Vector_PenMapping
    =0 for pen mapping; NULL otherwise
    1. AfterMovePoint

    Applicable to layer: points, polygons, trees,
    Input variables (pass value from FM to script):
    MovePoint_OldX
    MovePoint_OldY
    MovePoint_NewX
    MovePoint_NewY
    1. BeforeNewCentroid

    Applicable to layer: polygons,
    Input variables (pass value from FM to script):
    NewPoint_X
    NewPoint_Y
    IsMultiCentroid
    boolean value indicating new point as a centroid of multipolygon
    1. AfterNewCentroid

    Applicable to layer: polygons,
    Input variables (pass value from FM to script):
    NewPoint_X
    NewPoint_Y
    IsMultiCentroid
    boolean value indicating new point as a centroid of multipolygon
    1. BeforeNewLine

    Applicable to layer: lines, connections
    Input variables (pass value from FM to script):
    NewLine_X1
    NewLine_Y1
    NewLine_X2
    NewLine_Y2
    1. AfterPostLine

    Applicable to layer: lines, connections
    Input variables (pass value from FM to script):
    PostLine_X
    co-ordinates of the last edited of the line
    PostLine_Y
    PostLine_ID
    1. OnPointOutOfPlot

    Applicable to layer: points, lines, polygons, trees, deadwood, transects, connections
    1. OnClickToMap (since version X7)

    if not ScriptResult then OnMouseDown discontinue; combined with SELECT button
    Applicable to layer: points, lines, polygons, trees, deadwood, transects, connections
    Input variables (pass value from FM to script):
    ClickToMap_LayerName
    gives possibility to generalize script for multiple layers
    ClickToMap_X
    ClickToMap_Y
    1. OnDoubleClickToMap

    Applicable to layer: points, lines, polygons, trees, deadwood, transects, connections
    Input variables (pass value from FM to script):
    DoubleClickToMap_LayerName
    gives possibility to generalize script for multiple layers
    DoubleClickToMap_ID
    DoubleClickToMap_X
    DoubleClickToMap_Y
    1. OnDoubleClickToOverviewTable

    Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
    1. AfterExternalForm

    Applicable to layer: plots,points, lines, polygons, data, trees, deadwood, transects, connections
    Input variables (pass value from FM to script):
    ExternalForm_LibraryName
    name of DLL library
    1. OnStemProfileCalliperMeasurement (since version X7)

    Before saving D,H data and continue further measurement
    Applicable to layer: trees,
    1. OnStemProfileHeightIncrement (since version X7)

    Increment of height during on-line calliper measurement of stem profile
    Applicable to layer: trees,
    Input variables (pass value from FM to script):
    StemProfileCalliperHeight_m
    initial height before increment
    StemProfileCalliperHeightStep_m
    proposed increment
    Output variables (pass value from script to FM):
    StemProfileCalliperNextHeight_m
    decision on new height; if not created in script then h+step will be used
    1. OnActivateCalliperFrame (since version X7)

    Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
    1. BeforeDrawStemProfile (since version X7)

    Before drawing stem profile of tree layer
    Applicable to layer: trees,
    Output variables (pass value from script to FM):
    StemProfileExpansionFactors
    variant array [0..n,0..1] of [Ht,factor]; factor e.g. 1.23 will be applied for diameters above Ht
    StemProfileXML
    standard XML which will replace default data
    1. BeforeSelectHeightCandidates (since version X7)

    Prepare data for height candidate selection
    Applicable to layer: trees,
    Output variables (pass value from script to FM):
    InvalidTreeIDs
    list of tree IDs which cannot be selected; VarArray of IDs
    1. OnInvalidLiveCrownHeightMeasurement (since version X7)

    Applicable to layer: trees,
    Input variables (pass value from FM to script):
    TreeHeight_m
    Limiting height: total tree height
    LiveCrownHeight_m
    Value of current live crown height measurement
    1. OnInvalidDeadCrownHeightMeasurement (since version X7)

    Applicable to layer: trees,
    Input variables (pass value from FM to script):
    TreeHeight_m
    Limiting height: total tree height
    LiveCrownHeight_m
    Value of current live crown height measurement
    DeadCrownHeight_m
    Value of current dead crown height measurement
    1. BeforeShowInSeparateWindow (since version X7)

    show form in separate window
    Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
    1. AfterCloseSeparateWindow (since version X7)

    close form with separate window
    Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
    1. AfterGetAttributeValuesByMapOverlay (since version X7)

    after transfer of attribute values by GIS overlay
    Applicable to layer: points, polygons, trees,
    1. BeforeShowPhotoThumbnails (since version X8)

    show photo thumbnails
    Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
    Output variables (pass value from script to FM):
    PhotoAttribute
    Name of attribute which will be used as photo attribute
    TextAttributes
    Name of attributes which will be used for description; list separated by ,;| EXIFDATE is the name of attribute of datetime of photo origin; {value} for direct display of value

General Field-Map events

  1. Field-Map

    1. AfterOpenFieldMap

    1. BeforeCloseFieldMap

    Abort: yes
    1. AfterOpenSystemTables

    1. AfterOpenProject

    1. BeforeRunDLL

    Abort: yes
    Input variables (pass value from FM to script):
    DLL_FileName
    Filename without extension
    DLL_FilePath
    Path to DLL
    1. AfterRunDLL

    Input variables (pass value from FM to script):
    DLL_FileName
    Filename without extension
    DLL_FilePath
    Path to DLL
    DLL_Result
    Integer result value returned by DLL
    1. BeforeSynchronization

    Abort: yes
    1. AfterSynchronization

    1. BeforeRunDatabaseQueryTool

    Abort: yes
    Output variables (pass value from script to FM):
    IncludeAllInactiveLayers
    0-no 1-true
    IncludeInactiveLayers
    list of layernames separated by ; or |
    1. AfterRunDatabaseQueryTool

    1. OnKeyDown

    Abort: yes
    Input variables (pass value from FM to script):
    KeyCode
    key code [INT]
    ShiftPressed
    SHIFT key pressed [BOOL]
    CtrlPressed
    CTRL key pressed [BOOL]
    AltPressed
    ALT key pressed [BOOL]
    1. AfterNotebookPageChange

    Input variables (pass value from FM to script):
    NotebookName
    name of active notebook in format Notebook_{LayerName}
    ActivePageIndex
    index of currently active sheet in active notebook
    1. AfterAdjustSettings (since version X7)

    after FM settings being adjusted
    1. OnReceiveDataFromAnotherProject (since version X7)

    message/data coming from another running fmdc project
    Input variables (pass value from FM to script):
    MessageID
    ID of the message defined by the sender
    MessageGUID
    GUID of the message defined by the sender
    SenderProjectDir
    [PROJECTDIR] of the data sender
    MessageData
    string data coming from the sender
  1. Find Target Height (script)

    1. OnInvalidHeight

    raised when target height is not reached within tolerance
    Input variables (pass value from FM to script):
    FindTargetHeight_Height_m
    FindTargetHeight_TargetHeight_m
    FindTargetHeight_HeightTolerance_m
    FindTargetHeight_RemainingDistance_m
    1. OnValidHeight (since version X7)

    raised when target height was reached within tolerance
    Input variables (pass value from FM to script):
    FindTargetHeight_Height_m
    FindTargetHeight_TargetHeight_m
    FindTargetHeight_HeightTolerance_m
    FindTargetHeight_RemainingDistance_m
  1. Height

    1. BeforeMeasurement

    Abort: yes
    Input variables (pass value from FM to script):
    Height_LayerName
    layer name in which height measurement is performed
    Height_AttributeName
    attribute name for which height measurement is performed
    Output variables (pass value from script to FM):
    Height_HorizDistToStemCenter_m
    optional - premeasured distance to the tree; both HD and base INCL must be available
    Height_InclinationToStemBase_deg
    optional - premeasured inclination to the tree base; both HD and base INCL must be available
    Height_DBH_mm
    optional - value of DBH; half of it will be subtracted from mesured distance
    1. AfterMeasurement

    Input variables (pass value from FM to script):
    Height_LayerName
    layer name in which height measurement is performed
    Height_AttributeName
    attribute name for which height measurement is performed
    Height_HorizDistToStemCenter_m
    measured distance to the tree; both HD and base INCL must be available
    Height_InclinationToStemBase_deg
    measured inclination to the tree base; both HD and base INCL must be available
  1. Measurement

    1. AfterReceiveVector

    Abort: yes
    Input variables (pass value from FM to script):
    Vector_HorizontalDistance_m
    Vector_SlopeDistance_m
    Vector_Inclination_deg
    Vector_Inclination_perc
    Vector_HorizontalAngle_deg
    Vector_HorizontalAngle_gon
    Vector_PenMapping
    0=data from measurement device; 1-pen mapping data
    1. BeforeInputData (since version X8)

    user defined values which will be available in input dialog
    Output variables (pass value from script to FM):
    Input_HorizontalDistance_m
    Input_Inclination_deg
    Input_HorizontalAngle_deg
    1. AfterInputData

    Input variables (pass value from FM to script):
    Input_HorizontalDistance_m
    Input_SlopeDistance_m
    Input_Inclination_deg
    Input_Inclination_perc
    Input_HorizontalAngle_deg
    Input_HorizontalAngle_gon
    1. OnReceiveDataFromNonSpecificEquipment

    Input variables (pass value from FM to script):
    EquipmentID
    Identification of equipment sending the data: 1 or 2 or 3
    ReceivedData
    Data coming from the equipment
    1. OnReceiveCalliperData (since version X7)

    Abort: yes
    Input variables (pass value from FM to script):
    ReceiveCalliperData_LayerName
    ReceiveCalliperData_AttributeName
    attribute for data saving
    ReceiveCalliperData_Value
    value coming from calliper
  1. Mapping

    1. BeforeMapDraw

    1. AfterMapDraw

    1. BeforeTrackingLayerDraw

    1. AfterTrackingLayerDraw

    1. AfterMeasurePolygonArea (since version X7)

    Output variables (pass value from script to FM):
    CoordsOfMeasuredPolygon
    variant array [0..n,0..1] of [X,Y] i.e. coordinates of polygon drawing
    1. BeforeSaveMapScreenshotToFile (since version X8)

    Abort: yes
    Input variables (pass value from FM to script):
    Screenshot_TargetDPI
    DPI
    Screenshot_TargetImageWidth
    Image width
    Screenshot_TargetScale
    Image width
    Output variables (pass value from script to FM):
    Screenshot_Filename
    Suggested filename
    1. AfterMapScreenshotTrackingLayerDraw (since version X8)

  1. Remote Diameter

    1. BeforeMesurement

    Abort: yes
    Input variables (pass value from FM to script):
    RemoteDiameter_LayerName
    RemoteDiameter_AttributeName
    Output variables (pass value from script to FM):
    RemoteDiameter_DBH_mm
    RemoteDiameter_EnableReferenceDiameter (since version X7)
    0-disabled 1-enabled; if disabled, then pole must by at center of stem sideways
    RemoteDiameter_EnableUseDBH (since version X7)
    enabled button Use DBH: 0-disabled 1-enabled; if enabled and DBH available and EnableReferenceDiameter OFF => DBH will be automatically used for distanca to stem center
    RemoteDiameter_TreeHeight_m
    RemoteDiameter_HorizDistToStemCenter_m
    optional - premeasured distance to the tree; both HD and base INCL must be available
    RemoteDiameter_InclinationToStemBase_deg
    optional - premeasured inclination to the tree base; both HD and base INCL must be available
    RemoteDiameter_CheckUseMainPole_Height (since version X7)
    checkbox: 1-checked for inclination 2-and for distance
    RemoteDiameter_CheckUseMainPole_Offset (since version X7)
    checkbox: 1-checked
    RemoteDiameter_Height_m
    optional - premeasured height to the point of the diameter measurement
    RemoteDiameter_DistanceRepetitionCount (since version X7)
    optional - number of repeated distance measurement
    StemProfile_DistanceRepetitionSound (since version X7)
    optional - file with sound to be played prior repeated dist measurement
    1. BeforeHeightMeasurement

    Input variables (pass value from FM to script):
    RemoteDiameter_LayerName
    RemoteDiameter_AttributeName
    Empty when measuring stem profile
    Output variables (pass value from script to FM):
    RemoteDiameter_TargetHeight_m (since version X7)
    variable used in scripts before/after; it is removed when incl measurement is canceled
    1. AfterHeightMeasurement

    Abort: yes
    Input variables (pass value from FM to script):
    RemoteDiameter_LayerName
    RemoteDiameter_AttributeName
    Empty when measuring stem profile
    RemoteDiameter_Height_m (since version X7)
    current value of measured height
    1. OnReferenceDiameterMeasurement (since version X7)

    when main diameter is measured in remote diameter window
    Input variables (pass value from FM to script):
    RefDiam_LayerName
    RefDiam_Diameter_mm
    main diameter
    RefDiam_Height_m
    height of main diameter measurement
  1. Stem Profile

    1. BeforeProfileMeasurement

    Possibility of passing additional [H,D] data before local stem profile measurement
    Input variables (pass value from FM to script):
    StemProfile_LayerName
    StemProfile_AttributeName
    Output variables (pass value from script to FM):
    StemProfile_Species
    StemProfile_DBH_mm
    StemProfile_EnableUseDBH (since version X7)
    enabled button Use DBH: 0-disabled 1-enabled
    StemProfile_EnableReferenceDiameter (since version X7)
    0-disabled 1-enabled; if disabled, then pole must by at center of stem sideways
    StemProfile_TreeHeight_m
    StemProfile_DiameterUnit
    Value: 0-mm 1-cm
    StemProfile_Point1...n
    Set of numbered additional points of stem profile; string containing H,m and D,mm: 'H|D'
    StemProfile_HorizDistToStemCenter_m
    optional - premeasured distance to the tree; both HD and base INCL must be available
    StemProfile_InclinationToStemBase_deg
    optional - premeasured inclination to the tree base; both HD and base INCL must be available
    StemProfile_VolumeBottomType
    optional - mode of bottom height: 0-%TreeHeight, 1-%DBH 2-%StumpHeight 3-FixedHeight[m]
    StemProfile_VolumeBottomValue
    optional - value of log top relevant for chosen type
    StemProfile_VolumeTopType
    optional - mode of stem top: 0-%TreeHeight 1-diameter[cm]
    StemProfile_VolumeTopValue
    optional - value of log top relevant for chosen type
    StemProfile_DistanceRepetitionCount (since version X7)
    optional - number of repeated distance measurement
    StemProfile_DistanceRepetitionSound (since version X7)
    optional - file with sound to be played prior repeated dist measurement
    1. BeforeHeightMeasurement (since version X7)

    Input variables (pass value from FM to script):
    RemoteDiameter_LayerName
    RemoteDiameter_AttributeName
    Empty when measuring stem profile
    RemoteDiameter_HighestMeasuredHeight_m
    highest measured height sofar
    RemoteDiameter_ArrayOfMeasuredHeights_m
    vector of data - existing measurements: VarArrayOf([h1,h2,...])
    Output variables (pass value from script to FM):
    RemoteDiameter_TargetHeight_m
    variable used in scripts before/after; it is removed when incl measurement is canceled
    1. AfterHeightMeasurement (since version X7)

    Abort: yes
    Input variables (pass value from FM to script):
    RemoteDiameter_LayerName
    RemoteDiameter_AttributeName
    Empty when measuring stem profile
    RemoteDiameter_Height_m
    Output variables (pass value from script to FM):
    RemoteDiameter_HeightOk
    1. OnReferenceDiameterMeasurement (since version X7)

    when main diameter is measured in remote diameter window
    Input variables (pass value from FM to script):
    RefDiam_LayerName
    RefDiam_Ticks
    ticks of main diameter measurement
    RefDiam_Diameter_mm
    main diameter
    RefDiam_Height_m
    height of main diameter measurement
  1. Stand Density Measurement

    1. BeforeStandDensityMeasurement

    Input variables (pass value from FM to script):
    StandDensity_LayerName
    StandDensity_AttributeName
    Output variables (pass value from script to FM):
    StandDensity_PlotRadius_m
    StandDensity_MeanDBH_cm
    1. AfterTreeMeasurement

    Input variables (pass value from FM to script):
    StandDensity_LayerName
    StandDensity_AttributeName
    StandDensity_Distance_m
    StandDensity_TreePosition
  1. Sampling

    1. ChooseSamplingMethod

    Input variables (pass value from FM to script):
    Sampling_LayerName
    Sampling_AttributeName
    Output variables (pass value from script to FM):
    Sampling_Method
    Call specific sampling method: 20-angle count sampling 30-transect sampling
  1. Angle Count Sampling

    1. BeforeAngleCountSampling

    Input variables (pass value from FM to script):
    AngleCountSampling_LayerName
    AngleCountSampling_AttributeName
    Output variables (pass value from script to FM):
    AngleCountSampling_ClassifyingLayerName
    Layer containing lookup lists with classifiers, e.g. Species
    AngleCountSampling_BoundaryPolygon
    Polygon boundary co-ordinates in format XY|XY$XY|XY|...
    AngleCountSampling_AdditionalIdentifier
    Identifier to be added into angle-count plot ID: PPPAANN ParentPolygon+Additional identifer+Serial number of plot
    AngleCountSampling_AdditionalIdentifierAttributeName
    Attribute name in point layer of angel-count-plots to which AdditionalIdentifier will be stored
    AngleCountSampling_SuggestedPlotNumber
    Suggested number of sample plots
    1. BeforeAngleCountMeasurement

    Input variables (pass value from FM to script):
    AngleCountSampling_LayerName
    AngleCountSampling_AttributeName
    Output variables (pass value from script to FM):
    AngleCountSampling_BasicParametersXML
    XML with basic sampling parameters; created automatically when performing sampling
    AngleCountSampling_Method
    1-basic method /mean D and H (Czechia); 2-extended method with tree DBH /DBH-H chart (Germany)
    1. OnMissingClassifier

    Input variables (pass value from FM to script):
    AngleCountSampling_LayerName
    AngleCountSampling_AttributeName