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
if __name__ == '__main__':
arcpy.env.qualifiedFieldNames = False # Allow unqualified field names
lyr = arcpy.mapping.Layer(r"\\WC-HOMERB\Shared\GIS\Scratch\LayersForWilbur
and I get this error message:
Solved! Go to Solution.
Yep, that did the trick.
Also, for anyone who looks this up in the future, it looks like the target workspace path needs to already exist.
(In my case there is no E:\ drive in our network – I was trying to preconfigure the files on my machine so I could simply copy and paste them to the other one. It is a production machine, so I try to refrain from mucking about on it very much)
My above comment about the workspace path needing to exist was incorrect. All you need to do is set the validation flag to False. For example,