mxd = arcpy.mapping.MapDocument("current") #or provide full path to MXD df = arcpy.mapping.ListDataFrames(mxd, "df name") #replace with actual df name lyr = arcpy.mapping.ListLayers(mxd, "MyShapeFileLayer")[0] #replace with acutal layer name in TOC arcpy.mapping.RemoveLayer(df, lyr) mxd.save()
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.