AnsweredAssumed Answered

Fixing broken links on multiple mxds

Question asked by kltrooper on Mar 22, 2013
Latest reply on Apr 4, 2013 by Wayne_Whitley
I looked thru the esri sample code and determined that the "replaceDatasource" function may fix broken links. However, I need to modify the script to fix broken links in many mxds. I hoping someone can spot the problem in this script:

import arcpy, os, glob mxds_path = r'S:\\Users Shared\\LOpperman\\Town Scale MXDs\\MXDs\\targetlayers\\' layer_name = r'dams' data_frame = r'Primary'  for infile in glob.glob(os.path.join( mxds_path, "*.mxd" )):          mxd = arcpy.mapping.MapDocument(infile)           for df in arcpy.mapping.ListDataFrames(mxd, data_frame):              for lyr in arcpy.mapping.ListLayers(mxd, "", df):                lyr.replaceDataSource("dams")