All,
I am trying to get this script to loop thru a directory and change the datasources of specific feature classes in all mxds. I've been successful with the replaceworkspaces method, but am hitting a wall with the replacedatasources method.
I have posted 2 scripts....The BatchReplaceWorkspaces_tool.py is a bit rough but works well. It will go thru folders and subfolders changing specified workspaces. It saves maps back to 9.3 and mirrors the source directory structure.
I have attempted a similar tact with the replacedatasources method in the BatchReplaceDataSources_tool.py script, but to no avail.
I am recieving the following error with the latter script:
Traceback (most recent call last):
File "C:/scripts/Python/Testing/BatchReplaceDataSources_tool.py", line 28, in <module>
if lyr.dataSource == OldDS:
File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\arcobjects\_base.py", line 70, in _get
return convertArcObjectToPythonObject(getattr(self._arc_object, attr_name))
AttributeError: LayerObject: Get attribute dataSource does not exist
Wanted to see if anyone sees anything I don't.
Thanks
James