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...

Accessing parameters within a Python toolbox

Within a Python toolbox, the main body of the tool is found in the execute method. This is where any analysis, conversion, and data creation occurs. Within the execute method you can call other tools and access ArcPy or other custom or third-party Python functionality.

The execute method itself has arguments to assist in dealing with parameters and messages, including a list of parameter objects and a messages object.

def execute(self, parameters, messages):

Within the execute method, each parameter's value can be accessed from the list using the valueAsText method. Other Parameter object properties can be accessed as needed.

Access parameter values using the parameter's object valueAsText method:

def execute(self, parameters, messages):
    inFeatures      = parameters[0].valueAsText
    outFeatureClass = parameters[1].valueAsText

Related Topics

  • Writing messages in a Python toolbox
  • What is a Python toolbox?
  • Understanding script tool parameters
  • GetParameterAsText
  • GetParameter
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