TransWikia.com

Seeking Python Code Generator in ArcGIS Pro

Geographic Information Systems Asked by José Rojas on February 15, 2021

I would like to know if there is any way to use Python in ArcGIS Pro in a similar way to SPSS syntax.
I mean if there is a way that while I click in ArcGIS the code starts to auto-generate and then I can copy/edit it the way I want.
I ask this because I know that with R or Python someone can automate processes but I don’t know anything about those languages, and maybe this way would be easy to get familiar with the code (like in SPSS).

4 Answers

The short answer is no. BUT enter image description here

You can send a Python command that you have just run to the Python window as shown below

Answered by LeasMaps on February 15, 2021

Answered by LeasMaps on February 15, 2021

There is an ArcGIS Idea named A Macro Recorder for Python for something like this in the ArcMap application of ArcGIS Desktop:

Like the "macro recorder" of Excel, all your manual actions in ArcMap data view are instantly translated in Python commands.

You could post a new ArcGIS Idea there for a Macro Recorder that writes ArcPy code from ArcGIS Pro.

Answered by PolyGeo on February 15, 2021

It's not quite as direct, but using Pro's Tasks, you can have the application "record" what you're doing and clicking, and it will add all of the tools, toolbar items, and map views that you click to items in a task.

You can see the specifics in Esri's documentation.

This doesn't necessarily get you the Python, but can identify the specific items you click on by name, which you can then track down in Esri's Python docs. Useful for when the sequence you're recording isn't solely in the GP tool.

Answered by JoshC on February 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP