Updating and fixing data sources with arcpy mapping

Note: this dialog is intended primarily for preparing map documents for publication.Customizations (VBA code, UI Controls and custom toolbars), graphs, and table window appearance properties are removed from files when you update their data sources using this dialog.Very tedious work, but what the heck, that’s why they are a temp!

What I am looking for is a way to repair multiple map documents without having to specify the name of each layer that has a broken data source.

Map Document(r"Path\To\MXD") for df in arcpy.mapping. There is a portion of that help topic that discusses how a workspace path is defined, and what it includes.

There are differences for different types of data, whether file based, like shapefiles or rasters like Several definitions are provided to summarize the terms being used in this document: A workspace is a container for data.

Map Document(r"Path\To\MXD") for df in arcpy.mapping. Furthermore, when I remove the raster dataset from the mxd and rerun the same script it works fine.

Error Message: This is the traceback I get from running it with the raster dataset in the MXD: import arcpy File "C:\Program Files (x86)\Arc GIS\Desktop10.2\arcpy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "C:\Program Files (x86)\Arc GIS\Desktop10.2\arcpy\arcpy\_mapping.py", line 695, in find And Replace Workspace Path return convert Arc Object To Python Object(self._arc_And Replace Workspace Path(*gp_fixargs((find_workspace_path, replace_workspace_path, validate), True))) Value Error: Layer: Unexpected error Question: I was under the impression (Arc Py documentation) that raster datasets worked fine with the And Replace Worksapce Path method, yet I am still having these issues. Do I need to phrase my arguments differently, or do I need to use a different method to replace a raster path?

Leave a Reply