AnsweredAssumed Answered

Change data source - solution

Question asked by rfoscarini on Jan 20, 2015
Latest reply on Jan 22, 2015 by ebrimhall

I have in my job several MXDs (more than 500) and each one is different from another.

There is one specific shapefile (project_area_03-jan-2015.shp) that every map uses.

The big problem: Every week, the shapefile changes, and also changes the name of the shapefile:


project_area_03-jan-2015 means its the 3rd week of january 2015

project_area_04-jan-2015 means its the 3th week of january 2015, and goes forever.


For our actual projects, we changed the way we built the mxds and the shapefiles, so we dont have any problems.

But for this specific old (very old, before 2008), we still have the old architecture of the files.


Every week, we make a copy to another folder and open all +500 MXDs, then 'change data source' in that shapefile, to the new one.


We tried to use 'MapDocument.findAndReplaceWorkspacePaths' python, but it changes only the path. We need a script to change the entire path from the shapefile.


I want some help, that ghanges the shapefiles for me, in all MXDs inside the folder, like;


from  d:\projectalpha\project_area_03-jan-2015.shp  to  d:\projectalpha\project_area_04-jan-2015.shp