mxd = arcpy.mapping.MapDocument("CURRENT")
arcpy.RefreshTOC() arcpy.RefreshActiveView()
mxd = arcpy.mapping.MapDocument(r"j:\mxdfiles\mxdname.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] updateLayer = arcpy.mapping.ListLayers(mxd, "TestFC", df)[0] sourceLayer = arcpy.mapping.Layer(r"j:\test\test.lyr") arcpy.mapping.UpdateLayer(df, updateLayer, sourceLayer) mxd.save()
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.