Select to view content in your preferred language

Can ARCGIS generate python code and if so how does it work?

1839
3
08-22-2013 08:17 AM
BarryBarrios
Emerging Contributor
Like the "macro recorder" of Excel, can all your manual actions in ArcMap data view be instantly translated in Python commands? If so, how does it work. Honestly, I don't know where to start. I don't see a record button in none of the menu options. Someone told me it could be done.
Tags (2)
0 Kudos
3 Replies
StephenBugge
Emerging Contributor
I know that you can use the Model Builder to create process models and then export those to a Python script.  I am not aware of a feature that operates like the Macro Recorder offered in the MS Office applications however.  Using the model builder may be a good way to start.
0 Kudos
BarryBarrios
Emerging Contributor
Hi,

How do I use the Model builder to create process models and export to a python script? I don't know what the first step will be. Any simple example of how to use the Model Builder for this purpose is greatly appreciated. Even a screenshot or a video recorder showing how to do it, will be great.
0 Kudos
StephenBugge
Emerging Contributor
Suppose I want to generate buffers around the bus stops in this city to show the areas affected by a new anti-smoking ordinance, I'm going to use the model builder to do this even though this is a basic operation you would probably just use the tool to do in normal circumstance.
[ATTACH=CONFIG]26892[/ATTACH]

Once you have Model Builder Open, you can drag tools from the tool box in to it to add them to your model
[ATTACH=CONFIG]26895[/ATTACH]

DoubleClick on the Buffer Tool to open the tool dialog
[ATTACH=CONFIG]26896[/ATTACH]
I'm doing a 25 foot buffer around the bus stop points
Finally I am going to export to a Python Script:
[ATTACH=CONFIG]26897[/ATTACH]

Hope this helps
0 Kudos