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()
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.