List of all parameter names of all geoprocessing tools in ArcGIS Pro

506
5
Jump to solution
03-22-2023 10:21 AM
Bud
by
Notable Contributor

ArcGIS Pro 3.1


Is it possible to loop through all the geoprocessing tools in ArcGIS Pro and create a list of all their parameter names?

For example, find all GP tools that have a parameter called Output Location or Output Name.

Related: Consistent path and filename parameters in GP tools

0 Kudos
1 Solution

Accepted Solutions
DannyMcVey
Esri Contributor
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)

 

View solution in original post

5 Replies
DanPatterson
MVP Esteemed Contributor

To use your example of Export Features

The tool parameters are located in

C:\...Your install path...\Resources\ArcToolBox\toolboxes\Conversion Tools.tbx\ExportFeatures.tool\tool.content

You would need to parse the ArcToolBox\toolboxes folders, looking the tools in each toolset (*.tbx) , navigate into the particular tool (eg. ExportFeatures.tool) then open the file (tool.content) and look for the line containing params , For example

 

 

..... snip
   "params": {
        "in_features": {
            "displayname": "$rc:in_features.title",
            "datatype": {
                "type": "GPFeatureLayer"
            },
            "description": "$rc:in_features.descr"
        },
        "out_features": {
            "direction": "out",
            "displayname": "$rc:out_features.title",
            "datatype": {
                "type": "DEFeatureClass"
            },
            "depends": [
                "in_features"
            ],
            "description": "$rc:out_features.descr"

.... snip

 

 

doeable, but it might tie up your machine for a while


... sort of retired...
DannyMcVey
Esri Contributor
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)

 

DanPatterson
MVP Esteemed Contributor

@DannyMcVey  😁 he would discover so much more examining the actual folders


... sort of retired...
Bud
by
Notable Contributor

It looks like something similar was posted as a technical article on the Esri Support site:

List all geoprocessing tools containing specific parameter names in ArcGIS Pro using ArcPy (Article ID:000031510)

0 Kudos
Bud
by
Notable Contributor

Here's a version of the script that searches for wildcard text within the parameter name using the "in" keyword:

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

Related:

0 Kudos