import arcpy from arcpy import mapping mxd = mapping.MapDocument("CURRENT") df = mapping.ListDataFrames(mxd, "Layers")[0] addLayer = arcpy.mapping.Layer(r"C:\DATA\PA_DEM.lyr") mapping.AddLayer(df, addLayer) arcpy.RefreshTOC() arcpy.RefreshActiveView()
import arcpy from arcpy import mapping mxd = mapping.MapDocument("CURRENT") df = mapping.ListDataFrames(mxd, "Layers")[0] targetGroupLayer = mapping.ListLayers(mxd, "L00 (147,748K)", df)[0] addLayer = mapping.Layer(r"C:\DATA\PA_DEM.lyr") mapping.AddLayerToGroup(df, targetGroupLayer, addLayer, "BOTTOM") arcpy.RefreshTOC() arcpy.RefreshActiveView()
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.