Referencing map documents on a disk
In addition to being
able to reference the currently active map document file in ArcMap, you can also access map document files stored on a local or remote drive using the MapDocument()
method. In this recipe, you'll learn how to access these map documents.
Getting ready
As I mentioned earlier, you can also reference a map document file that resides somewhere on your computer or a shared server. This is done simply by providing a path to the file. This is a more versatile way of obtaining a reference to a map document because it can be run outside the ArcGIS Python window or a custom script tool.
How to do it…
Follow these steps to learn how to access a map document stored on a local or remote drive:
Open the IDLE development environment from Start | Programs | ArcGIS | Python 2.7 | IDLE.
Create a new IDLE script window by selecting New | New Window from the IDLE shell window.
Import
arcpy.mapping
:import arcpy.mapping as mapping
Reference the copy of the
crime...