Field-Map Scripting Events
Attribute events
OnChange
Launched by attribute value change. New value of attribute can be used for further data processing.
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;
Layer events
BeforeCancel
Applicable to: all layer types
AfterCancel
Applicable to: all layer types
BeforeDelete
Applicable to: all layer types
AfterDelete
Applicable to: all layer types
BeforeEdit
Applicable to: all layer types
AfterEdit
Applicable to: all layer types
BeforeInsert
Applicable to: all layer types
AfterInsert
Applicable to: all layer types
BeforePost
Applicable to: all layer types
AfterPost
Applicable to: all layer types
BeforeScroll
Applicable to: all layer types
AfterScroll
Applicable to: all layer types
AfterDeletePlot
Applicable to layer: plots,
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
AfterBuildPolygons
Applicable to layer: plots,polygons,
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
BeforeNewPoint (since version X8)
Applicable to layer: points, polygons, trees,
Input variables (pass value from FM to script):
NewPoint_X
NewPoint_Y
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
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)
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
AfterMovePoint
Applicable to layer: points, polygons, trees,
Input variables (pass value from FM to script):
MovePoint_OldX
MovePoint_OldY
MovePoint_NewX
MovePoint_NewY
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
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
BeforeNewLine
Applicable to layer: lines, connections
Input variables (pass value from FM to script):
NewLine_X1
NewLine_Y1
NewLine_X2
NewLine_Y2
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
OnPointOutOfPlot
Applicable to layer: points, lines, polygons, trees, deadwood, transects, connections
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
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
OnDoubleClickToOverviewTable
Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
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
OnStemProfileCalliperMeasurement (since version X7)
Before saving D,H data and continue further measurement
Applicable to layer: trees,
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
OnActivateCalliperFrame (since version X7)
Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
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
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
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
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
BeforeShowInSeparateWindow (since version X7)
show form in separate window
Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
AfterCloseSeparateWindow (since version X7)
close form with separate window
Applicable to layer: points, lines, polygons, data, trees, deadwood, transects, connections
AfterGetAttributeValuesByMapOverlay (since version X7)
after transfer of attribute values by GIS overlay
Applicable to layer: points, polygons, trees,
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
Field-Map
AfterOpenFieldMap
BeforeCloseFieldMap
Abort: yes
AfterOpenSystemTables
AfterOpenProject
BeforeRunDLL
Abort: yes
Input variables (pass value from FM to script):
DLL_FileName
Filename without extension
DLL_FilePath
Path to DLL
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
BeforeSynchronization
Abort: yes
AfterSynchronization
BeforeRunDatabaseQueryTool
Abort: yes
Output variables (pass value from script to FM):
IncludeAllInactiveLayers
0-no 1-true
IncludeInactiveLayers
list of layernames separated by ; or |
AfterRunDatabaseQueryTool
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]
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
AfterAdjustSettings (since version X7)
after FM settings being adjusted
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
Find Target Height (script)
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
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
Height
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
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
Measurement
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
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
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
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
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
Mapping
BeforeMapDraw
AfterMapDraw
BeforeTrackingLayerDraw
AfterTrackingLayerDraw
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
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
AfterMapScreenshotTrackingLayerDraw (since version X8)
Remote Diameter
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
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
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
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
Stem Profile
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
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
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
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
Stand Density Measurement
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
AfterTreeMeasurement
Input variables (pass value from FM to script):
StandDensity_LayerName
StandDensity_AttributeName
StandDensity_Distance_m
StandDensity_TreePosition
Sampling
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
Angle Count Sampling
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
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)
OnMissingClassifier
Input variables (pass value from FM to script):
AngleCountSampling_LayerName
AngleCountSampling_AttributeName