AnsweredAssumed Answered

Changing path in layer file

Question asked by Tycho on Oct 13, 2016
Latest reply on Oct 14, 2016 by Tycho

I am sure I am missing something simple (I usually just steal code snippets and try to string them together). I want to change the data source path in a bunch of layer files (I will add in a for… loop once I get this to work). This is a simple layer file, I will also need to update Group layer files

def main():
pass

if __name__ == '__main__':
main()
#Modules
import arcpy
#import string

#Environments
arcpy.env.qualifiedFieldNames = False # Allow unqualified field names
arcpy.env.overwriteOutput

 

lyr = arcpy.mapping.Layer(r"\\WC-HOMERB\Shared\GIS\Scratch\LayersForWilbur
\LegalParcelData.lyr")

 

lyr.findAndReplaceWorkspacePaths(r"\\WC-HOMERB\Shared\GIS\GeoDatabase", r"E:
\GISData103\Data")

 

lyr.save()

 

and I get this error message:

 

Help…

Outcomes