Geoprocessing Commands vs Ribbon Commands and getting Python Code Question

581
4
03-07-2023 08:48 AM
Labels (1)
PeteJordan
Occasional Contributor III

  Is there a specifc reason that processes such as Select by Location or Selecty by Attributes, for example, allow you to copy the Python Code from the Run button if you use them through Toolbox, but that option isn't avaliable if you access these through the Map Tab on the Ribbon?

  I see they do have different ID's (example: esri_geoprocessing_selectByLocationButton and esri_geoprocessing_management_SelectLayerByLocation), but I would think they should be able to have the exact same functionality as each other, unless I'm missing something internally that there is a reason they aren't?

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

Ribbon access are shortcuts and simplifications for the most/some cases.  I have always found it best to use the tools in arctoolbox directly simply for the fact that each tool has an Environments tab where you can set environment parameters that you cant through the ribbon


... sort of retired...
PeteJordan
Occasional Contributor III

@Dan I guess that's all it is then, just a simplified version.  I just never realized that until now when I needed the Python code, but like you said, I notice the Environment is also only in the Geoprocessing one as well.

  Guess I'll have to always keep that in mind with other functions that I use on the ribbon then, that I may be missing out on some features...

0 Kudos
Luke_Pinner
MVP Regular Contributor

After you run from the ribbon, just go to the History tab,  right click the tool result you just ran and select "Copy Python Command".  

PeteJordan
Occasional Contributor III

Good to know there are other options like this then...

0 Kudos