# Remove empty group layers ListLyr = arcpy.mapping.ListLayers(df) if ListLyr: for lyr in ListLyr: count = 0 if lyr.isGroupLayer: for sublyr in lyr: count = count + 1 if count == 0: arcpy.mapping.RemoveLayer(df, lyr) arcpy.AddMessage("Removed layer " + lyr.name) mxd.save()
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.