AnsweredAssumed Answered

Changing data source of .lyr files

Question asked by Tycho on Jan 27, 2015
Latest reply on Feb 6, 2015 by Tycho

I've got 65 layer files (both normal and group ones) that need their data sources changed. I got the following script to work for MXDs (which is good since there are several hundred):

 

HomerString = [list of mxds with paths]
for bob in HomerString:
    mxd = arcpy.mapping.MapDocument(bob)
 mxd.findAndReplaceWorkspacePaths("WC-HOMER", "WC-HOMERB")
    NewString = bob.replace(r'\\WC-HOMER', r'\\WC-HOMERB')
    mxd.saveACopy(NewString)
    del mxd

 

But I cannot figure out any variation of it that will work for .lyr files

(and I did look at code snippets, help documents, and Google before posting here)

Any ideas or solutions out there?

Thanks,

 

Tycho

Outcomes