Nahide

MXD re-setting the links help please!

Discussion created by Nahide on Aug 22, 2012
Latest reply on Aug 23, 2012 by jskinner-esristaff
Hi,

I have python script to resetting the links for mxds. But could not get it to work.

Please help!

import arcpy, os
path = "Z:\Maps"
for root, dirs, files in os.walk(path):
for fileName in files:
  basename, extension = os.path.splitext(fileName)
  if extension == ".mxd":
   fullPath = os.path.join(root, fileName)
   mxd = arcpy.mapping.MapDocumnet(fullPath)
   mxd.findAndReplaceWorkspacePaths("Z:\maps\xxx.mdb", "Z:\maps\cultural\xxx.mdb")
   mxd.saveACopy("Z:\maps\cultural\repaired_links")
   print mxd.dateSaved

Thanks in advance!

Outcomes