I have a number of layers that I want to manipulate with ArcPy. On my ArcGIS Pro map I have them under a group layer.
To deal with them, I have been picking them by name as follows:
for theLayer in theMaps.listLayers(): # print (theLayer.name) if theLayer.supports("ISFEATURELAYER"): if theLayer.isFeatureLayer and theLayer.name[:10] == "....":
but I'm wondering if I cannot just reference them by group?
Parsing the name creates an admin overhead to rename the sources first.
if theLayer.parentlayer == "MyGroupLayerName":
The Layer class documentation does not offer any solution to this.