laptop and a wrench

Bug

The 'addLayerToGroup' python function adds the layer redundantly to the target group layer as well as in the Table Of Contents as a separate layer in ArcGIS Pro.

Last Published: February 18, 2019 ArcGIS Pro
Bug ID Number BUG-000110978
SubmittedJanuary 20, 2018
Last ModifiedJune 5, 2024
Applies toArcGIS Pro
Version found2.1
StatusWill Not Be Addressed

Additional Information

This is being marked as designed. If you look at the code carefully, when calling m.addDataFromPath WITHIN addLayerToGroup, it is doing two things: First, adding a layer to the map AND also adding a layer to the group. The work around is to either add a layer to the map and then use MOVELAYER or reference a layer file. See code sample below#AddLayerToGroupm.addLayerToGroup(grpLyr, lyrFile, "TOP") #THIS DOES NOT DUPLICATEm.addLayerToGroup(grpLyr, m.addDataFromPath(FC), "TOP") #THIS DOES

Steps to Reproduce

Bug ID: BUG-000110978

Software:

  • ArcGIS Pro

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options