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
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)
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
@DannyMcVey 😁 he would discover so much more examining the actual folders
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)
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:
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.