import arcpy, os # INPUT PARAMETERS Input_mxd = "G:\GIS\Weave\mxd\REBUILD\DataSrceTesting_2LblLayers_PptySbrbs.mxd" Output_mxd = "G:\GIS\Weave\mxd\REBUILD\newDataSource_EmptyOutput_3.mxd" Input_SDE = "Database Connections\Connection to vgeodb.sde" Output_SDE = "G:\GIS\Weave\Connections\Connection to 10.1.4.127.sde" mxd = arcpy.mapping.MapDocument(Input_mxd) for lyr in arcpy.mapping.ListLayers (mxd): mxd.findAndReplaceWorkspacePaths(Input_SDE, Output_SDE) print lyr print lyr.dataSource mxd.saveACopy(Output_mxd)
Solved! Go to Solution.
import shutil
Output_mxd = r"G:\GIS\Weave\mxd\REBUILD\newDataSource_EmptyOutput_3.mxd"
import shutil
Output_mxd = r"G:\GIS\Weave\mxd\REBUILD\newDataSource_EmptyOutput_3.mxd"
Is perhaps putting an "r" in front of strings new to Arcpython under version 10? I don't recall this from 9.3, and it doesn't seem to be in my sample scripts from then.
print r'testing \n'
print 'testing \n'