Today Craig Carpenter and myself have presented on geoprocessing in ArcGIS.
I think one of the challenges in any automation exercise is understanding exactly what the desired outcomes are and the most optimal method to achieve these results. If you know what the end game is, the detail can often take care of itself.
In this session the goal has been to highlight how you can use both model builder and Python scripting to perform structural changes and repetitive tasks against geodatabases. With the final outcome being reusable script which can be run automatically at a desired time without manual interaction.
The session started out with myself building a model in ArcGIS to perform field addition tasks and calculation tasks. Followed by database compaction and the finally geodatabase backup. The full model can be seen below.
In this model we also showed how Python can be embedded in the model and inline variables can be applied to simplify the model creation and reusability. However, a model only runs inside ArcGIS and is limited to the capabilities of ArcGIS, so using the export tools the model was converted to a python script.
From there Craig picked up the raw Python script and enhanced it. Python offers the ability to add other functions outside of ArcGIS. So Craig added error checking, streamlined the script and added email notification. Finally, Craig used windows scheduler to automatically run the script at a desired day and time each week. The detail of the final script can be seen attached.