Field-Map Scripting

3.4.2 Using Field-Map predefined variables

Using Field-Map predefined variables


There are a number of predefined variables available in Field-Map which make Field-Map scripting more convenient an effective. Some of them have fixed names and some have derived names.


Predefined variables with fixed names:


DisableEvents

The "DisableEvents" variable is used to prevent circular dependency in scripts. For more information, see the Disabling events chapter.


Project

The "Project" variable represents the currently opened Field-Map project. For more information, see the Accessing Field-Map data within a script chapter.


ProjectDir

The "ProjectDir" variable holds the path to the project folder as a string.


ProjectName

The "ProjectName" is a string variable containing the name of the currently opened project.


ScriptResult

The "ScriptResult" variable is used in On-Validate scripts. See the On-Validate scripts chapter to learn more.


SystemDir

The "SystemDir" variable holds the path to the system folder as a string.


UserDir

The "UserDir" variable holds the path to the user folder as a string.


ValidationFailedMessageText

The "ValidationFailedMessageText" variable can be used to customize a warning message of an on-validate script.







Predefined variables with derived names:

There is an automatically created variable for each Field-Map layer named the same as the corresponding layer. For more information, see the Accessing Field-Map data within a script chapter.


Predefined variables to show context help:

There are predefined variables for each class that can be used in context help. Typing a predefined variable followed by a dot will list available methods and properties.

Class name

Predefined variable(s)

TProjectWrapper

project

TLayerWrapper

lr

TTableWrapper

tb, tab (CrownProjection, CrownProfile, CrownProfilePoints)

TXMLOutputWrapper

xmlout, xmloutput

TStringListWrapper

lst, strings, stringlist

TIntegerListWrapper

intlist, ilst, ilist

TVariantListWrapper

varlist, vlst, vlist

TMultiVariantListWrapper

multivarlist, mvlst, mvlist

TVarVariantListWrapper

varvarlist, vvlst, vvlist

TStemProfileWrapper

stem

TSpeciesGroupsWrapper

specgroups, spg,  speciesgroups

TPointWrapper

point, pt

TLineWrapper

line, lin

TPolygonWrapper

polygon, pol

TObjectListWrapper

objlist, olst, olist

TExcelWrapper

xls, myexcel, excel

TScriptOrganizer

sco, scriptorganizer

TVolumeModelsWrapper

volmodels, volumemodels, vm

TAttribDefsWrapper

attribdefs, attdefs

NOTE: Names are NOT case sensitive


Example: Typing a "lr." will list TLayerWrapper methods.


See also:

Accessing Field-Map data within a script; Using Field-Map predefined variables; Using Field-Map global variables; Disabling events; Referencing scripts