for lyr in arcpy.mapping.ListLayers(mxd): if lyr.isGroupLayer: #Then lyr is a Group Layer for sublyr in lyr: #now sublyr is an item in the group
layers = arcpy.mapping.ListLayers(mxd) for lyr in layers: if lyr.supports('datasetname'): print('probably an fc layer') else: print('probably some other kind of layer')
layers = arcpy.mapping.ListLayers(mxd) for lyr in layers: if lyr.isGroupLayer: group_lyr = lyr.name print('This is a group layer') elif lyr.longName.split(os.sep)[0] == group_lyr: print('lyr is in group layer')
lyrList = sorted(set([os.path.basename(str(lyr)) for lyr in arcpy.mapping.ListLayers(mxd) if not lyr.isGroupLayer]))
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.