IGPDispatch object |
|
Release 9.1
Last modified August 19, 2005 |
Print all topics in : "Scripting Object: Properties and methods" |
IGPDispatch methods and properties exposed for scripting and command line usage. They do not exist as tools in any toolbox.
Scripting is the ability to use the geoprocessor functions from any number of current scripting environments, such as Python, VBScript, JScript, and Perl. A new ArcObjects component, the geoprocessor object, will be the main vehicle for exposing the geoprocessing functions to the scripting languages. It is an object that provides a single access point and environment for the execution of any geoprocessing tool in ArcGIS, including extensions. GPDispatch is a COM wrapper for the geoprocessor that supports scripting languages. IDispatch is a text communicator—that is, strings, or objects, are passed from the script to the geoprocessor and understood as commands (actions), and/or values. IDispatch is built into the geoprocessor and known as GPDispatch, making it possible for interpretive and macro languages to access the more than 400 available tools.
For further information about scripting, its uses within a GIS, which scripting language to use, as well as additional samples, see An overview of writing geoprocessing scripts.
Expression | Explanation |
AddError | Adds a return message of severity=2 to the queue. |
AddMessage | Adds a return message of severity=0 to the queue. |
AddReturnMessage | Adds a message, from the function message queue, to the return queue. |
AddToolbox | Gets the specified toolbox and exposes its functionality. |
AddWarning | Adds a return message of severity=1 to the queue. |
CheckExtension | Used to see if a license is available to be checked out for a specific type of extension. |
CheckInExtension | Used to return the license to the License Manager so other applications may use it. |
CheckOutExtension | Used to actually retrieve the license for a specific type of extension. |
CheckProduct | Used to see which desktop licenses are available. |
Command | Parses the specified command line as a string. |
CopyParameter | Copies the selected parameter definition to the specified parameter list. |
CreateObject | Copies the selected parameter definition to the specified parameter list. |
Describe | Describes such properties as type, name, spatial reference, domains, versioning, etc., for DataElements such as FeatureClasses, Tables, GeoDatasets, CoverageFeatureClasses, Datasets, RelationshipClasses, Files, Layers, Workspaces, as well as GP objects such as TableViews and FeatureLayers. |
Exists | Tests if the specified input exists and returns a boolean value. |
Expression | Explanation |
GetMessage | Gets the specified message descriptions that were returned. |
GetMessages | Gets all message descriptions that were returned. |
GetParameter | Gets the specified parameter, by its index position, from the list of parameters. |
GetParameterAsText | Selects (by index) the specified parameter from the present list of parameters. Similar to the GetParam method, but returns a string. |
GetReturnCode | For the specified message index, where the severity=2, the error code is returned. |
GetSeverity | Returns the severity of the message of the given index (0=ok, 1=warning, 2=error). |
GetSystemEnvironment | Gets the specified system environment variable. |
InsertCursor | Used to insert rows into a table or feature class. This method will return a Dispatch enumeration object that will, in turn, hand out Dispatch row objects. |
ListDatasets | Lists all datasets that fit the search criteria. Specifying search conditions (wildcard) and a feature type will limit the results. |
ListEnvironments | Lists all environment settings that fit the search criteria. Specifying search conditions (wildcard) will limit the results. |
ListFeatureClasses | Lists all feature classes from the selected workspace. Specifying search conditions (wildcard) and a feature type will limit the results. |
ListFields | List all the fields in the specified table, feature class, or shapefile. Specifying search conditions (wildcard) and a field type will limit the results. |
ListIndexes | List all the indexes in the specified table, feature class, or shapefile. Specifying search conditions (wildcard) will limit the results. |
ListRasters | Lists all rasters from the selected workspace. Specifying search conditions (wildcard) and a feature type will limit the results. |
ListTables | Lists all tables from the selected workspace. Specifying search conditions (wildcard) and a table type will limit the results. |
ListToolboxes | Lists all toolboxes that fit the search criteria. Specifying search conditions (wildcard) will limit the results. |
ListTools | Lists all tools that fit the search criteria. Specifying search conditions (wildcard) will limit the results. |
ListWorkspaces | Lists all workspaces within the selected workspace. Specifying search conditions (wildcard) and a workspace type will limit the results. |
Expression | Explanation |
MaxSeverity | Sets the maximum severity. |
MessageCount | Returns a numeric count of all the returned messages from the last executed command. |
OverWriteOutput | Used to allow or not allow the overwriting of existing outputs. |
ParameterCount | The number of parameters returned. |
ParseFieldName | Truncates a portion of the specified field name. |
ParseTableName | Truncates a portion of the specified table name. |
ProductInfo | Used to report what the current product license is. |
QualifyFieldName | Prefixes a field name string with the database.username, if required. |
QualifyTableName | Prefixes a table name string with the database.username, if required. |
RefreshCatalog | Refreshes the ArcCatalog tree view. |
RemoveToolbox | Removes access to named toolbox for this current session. |
Expression | Explanation |
SearchCursor | Establishes a cursor for searching through field rows. This method will return a Dispatch enumeration object that will, in turn, hand out Dispatch row objects. |
SetParameter | Sets the specified parameter property. The parameter being set is selected from the existing parameter list by its index. |
SetParameterAsText | Sets the specified parameter property by allowing a string input. The parameter being set is selected from the existing parameter list by its index. |
SetProduct | Used to define the desktop license used by a script. |
TemporaryMapLayers | The output(s) from a successfully executed function will be added to the active map layer, for the current session only. At the end of the session the layers will be removed from memory. |
TestSchemaLock | Tests if a schema lock can be acquired for a table, feature class, or feature dataset. A number of tools require a schema lock on the input data because they alter the data’s schema. The Add Field tool is an example of such a tool. Scripts may want to test if a schema lock can be acquired on a dataset so unnecessary processing can be avoided. If a tool requires a schema lock and it cannot acquire one at the time of execution, an appropriate error message is returned. The method does not actually apply the schema lock. |
Toolbox | Specify the toolbox for the current geoprocessing session. |
UpdateCursor | Used to positionally update and delete rows in a table. |
Usage | Displays the syntax for the specified function. |
ValidateFieldName | Returns a valid field name based on name restrictions present in the output geodatabase. |
ValidateTableName | Returns a valid table name based on name restrictions present in the output geodatabase. |