Contents
Do you need to open ArcGIS to open MXD?
What I want to fulfill is, that I don’t need to open ArcGIS again for starting the new mxd and instead of this open the new mxd in the current ArcGIS session. Does anybody have experience with this and can help me?
Can you save an open MXD in Python?
You cannot save an open MXD from a python IDE external to ArcGIS. You can, however, make changes to and save an MXD using Python from ArcMap itself. Open the python window (or you can attach to a script tool if you prefer) and run your python from inside the open MXD.
How to define current map document in ArcMap?
Add double quotes and change out backslash to forward slash: If you only have one map document open you can define current map as: Maybe you open the mxd file in arcmap and this file marked as open file and python can’t overwrite the file. i think your error is IOError: MapDocObject: Unable to save.
What should my path look like in ArcPy?
Your path should look like this, using arcpy.mapping.MapDocument and surround your path with double quotes and double up your back slash: Add double quotes and change out backslash to forward slash: If you only have one map document open you can define current map as:
How does the mapdocument function in ArcPy work?
The MapDocument function returns a MapDocument object reference to a variable called mxd. The string CURRENT is a keyword used to reference the currently loaded map document. In place of CURRENT, this is where you could also provide a path to the map document.
How to use MXD to create a web map?
The Esri basemap to be used in the web map. The portal folder in which to create the web map. If the folder does not already exist, it will be created. The following Python window script demonstrates how to use the MXDToWebMap function in immediate mode. Create a web map from a map document.
In ArcMap, click File > Map Document Properties. You should see that the author property is set to your string. You just interacted directly with the MapDocument object through the variable called mxd. There are many other methods and properties on the MapDocument object. Now you will save your changes.