HOW TO

List all geoprocessing tools containing specific parameter names in ArcGIS Pro using ArcPy

Last Published: November 22, 2023

Summary

In ArcGIS Pro it is possible to list tools containing specific parameter names. This is ideal for situations when creating programmatically automated tasks using ArcPy, as knowing the exact parameter names is crucial. It is also important during workflow testing as a complete list of parameter names ensures all possible inputs are considered and tested.

Procedure

  1. Open a project in ArcGIS Pro.
  2. Open the Python window. Refer to ArcGIS Pro: Python window for more information.
  3. Run the following script:
    1. Iterate over a list of tools available in ArcGIS.
for tool in arcpy.ListTools("*"):
  1. Retrieve information about the parameters associated with that tool.
    params = arcpy.GetParameterInfo(tool)
  1. Iterate over the list of parameters associated with the current tool and check if the name of the parameter is within the tool. Replace '<parameterName1>' and '<parameterName2>' with the names of the desired parameters. The names of the tools are listed below the print() function.
    for param in params:
      if param.name == "<parameterName1>" or param.name == "<parameterName2>":
            print(tool, param.name)

The code block below demonstrates the full working script.

for tool in arcpy.ListTools("*"):
    params = arcpy.GetParameterInfo(tool)
    for param in params:
        if param.name == "output_location" or param.name == "output_name":
            print(tool, param.name)

The image below shows all the geoprocessing tools containing the specific parameter names in ArcGIS Pro.

All geoprocessing tools are listed

Article ID:000031510

Software:
  • ArcGIS Pro 3 1
  • ArcGIS Pro 3 0
  • ArcGIS Pro 3 2

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic