Bug
| Bug-ID-Nummer | BUG-000180673 |
|---|---|
| Eingereicht | November 3, 2025 |
| Zuletzt geändert | November 11, 2025 |
| Gilt für | ArcGIS Pro |
| Gefunden in Version | 3.3.6 |
| Betriebssystem | Windows OS |
| Betriebssystemversion | 11.0 64 bit |
| Status | Under Consideration |
Check if the layer is a subtype group layer and if there are child layers. If these child layers exist query each layer individually. This also makes a list of non-subtyped layers and child Subtype layers for editing. Refer to the example below:
def get_un_layers2(currentmap,selection_only: bool):
# This function gathers known UN Subtype Group Layers, iterates through them,
# and returns a list of editable Layers and Subtype Layers.
# The selection_only = True option sets the function to only return layers with an active selection set.
arcpy.AddMessage(f'Getting UN Layers')
arcpy.AddMessage(f'Only process UN layers with selected features? {selection_only}')
top_level_layers = []
un_layers = []
un_layer_names = ['Stormwater Device',
'Stormwater Junction',
'Stormwater Line',
'Structure Boundary']
all_layers = currentmap.listLayers()
for layer in all_layers:
if layer.name in un_layer_names:
top_level_layers.append(layer)
# arcpy.AddMessage(f'Found expected Top Level layer: {layer.name}')
del layer
for layer in top_level_layers:
subtype_group_layer = layer.listLayers()
if subtype_group_layer:
for subtypelayer in subtype_group_layer:
if selection_only is True:
if subtypelayer.getSelectionSet():
un_layers.append(subtypelayer)
# arcpy.AddMessage(f'Found Subtype Layer: {subtypelayer.longName}')
elif selection_only is False:
un_layers.append(subtypelayer)
# arcpy.AddMessage(f'Found Subtype Layer: {subtypelayer.longName}')
del subtypelayer
else:
if selection_only is True:
if layer.getSelectionSet():
un_layers.append(layer)
# arcpy.AddMessage(f'Found Non-Subtyped Top Level Layer: {layer.longName}')
elif selection_only is False:
un_layers.append(layer)
# arcpy.AddMessage(f'Found Non-Subtyped Top Level Layer: {layer.longName}')
del layer
if not un_layers:
arcpy.AddError('No UN layers found. Check for active selection if using selection_only = True option.')
sys.exit()
return un_layers2
Clearing the selection first and using the same where clause in the cursor returns the correct results.
Bug-ID: BUG-000180673
Software:
Unterstützung durch ArcGIS-Experten anfordern
Esri Support App herunterladen