4

Writing ArcPy code for ArcGIS Desktop I will often run a Geoprocessing tool and then go to the Geoprocessing | Results window to right-click on that successful run to Copy As Python Snippet so that I can Paste that code into my script.

What is the equivalent workflow for ArcGIS Pro?

5

After running a tool from the Geoprocessing pane, I found that I could right click on the successful run at the bottom (in green) and choose Copy Python command.

enter image description here

Alternatively, I could use ANALYSIS | History to open the Project pane's Geoprocessing History and right-click the successful run there to choose Copy Python command.

enter image description here

Either workflow above places code like that below into the Paste buffer ready to be pasted into a script:

arcpy.management.CreateFishnet(r"C:\Temp\TestProj\TestProj.gdb\TestFishnet", "110 -35", "110 -20", 2, 1, None, None, "150 -20", "NO_LABELS", "DEFAULT", "POLYGON")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.