DamianMilne

replaceDataSource error

Discussion created by DamianMilne on Jan 13, 2013
Latest reply on Jan 14, 2013 by Wayne_Whitley
Assuming my path names are correct, can anyone suggest a reason why the "replaceDataSource" line in my python script keeps returning an error? Cheers, Damian

import arcpy

lyrFile = arcpy.mapping.Layer(r"C:\Damian\RAV Action Plan\Layers_GP\TT10.lyr")
for lyr in arcpy.mapping.ListLayers(lyrFile, "AllRav"):
    lyr.replaceDataSource(r"C:\Damian\RAV Action Plan\RAVs.gdb","FILEGDB_WORKSPACE","SP_10")
    lyr.name = "SP_10"
    lyr.saveACopy(r"C:/Damian/RAV Action Plan/Layers_GP/TTT10.lyr")
del lyrFile

Outcomes