ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Understanding script tool parameters

  • Parameter order must match
  • Parameter data types

Almost all tools have parameters, and you set their values on the tool dialog box or within a script. When the tool is executed, the parameter values are sent to your tool's source code. Your script reads these values and proceeds with its work.

The illustration below shows a script tool dialog box with three parameters: an input workspace, a clip feature class, and an output workspace. All feature classes in the input workspace are clipped to the clip feature class (using the Clip tool) and written to the output workspace.

Script tool parameters

Parameter order must match

The parameter order on the tool dialog box must match the parameter order in your script. If, for example, you change the Clip Features from parameter 2 to parameter 1 in the script tool, you must also change the parameter order in the script tool's properties.

Parameter data types

Every script tool parameter has an associated data type. When the script tool dialog box is opened, geoprocessing uses the data type to check the parameter value. For example, if you enter a feature class for a parameter with a workspace data type, geoprocessing generates an error (a red X on the dialog box), as shown below.

Geoprocessing generates an error when data types don't match

The data type is also used in browsing for data—only data that matches the parameter data type will be shown in the browse dialog box.

Browsing based on data type

Another way to think about parameters and data types is that geoprocessing does not send values to your script that are of the incorrect data type. This is one distinct advantage to creating a script tool—the parameter value is checked against the parameter data type before the value is sent to your script.

Related Topics

  • Accessing parameters in a script tool
  • Setting script tool parameters
  • Defining parameters in a Python toolbox
  • Accessing parameters within a Python toolbox
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal