Solved! Go to Solution.
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')
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
lyrList = sorted(set([os.path.basename(str(lyr)) for lyr in arcpy.mapping.ListLayers(mxd) if not lyr.isGroupLayer]))