<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: AddLayerToGroup in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/addlayertogroup/m-p/1280878#M68176</link>
    <description>&lt;P&gt;So this might fix the layer duplication issue, I haven't tried it yet:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/the-addlayertogroup-python-function-adds-the-layer-redu-bug-000110978" target="_blank"&gt;https://support.esri.com/en-us/bug/the-addlayertogroup-python-function-adds-the-layer-redu-bug-000110978&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2023 16:50:00 GMT</pubDate>
    <dc:creator>nsidaniel</dc:creator>
    <dc:date>2023-04-20T16:50:00Z</dc:date>
    <item>
      <title>AddLayerToGroup</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/addlayertogroup/m-p/152410#M6826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script that produces several raster layers (10-20) from a netCDF.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use addLayerToGroup to add the rasters to a group, the layers are duplicated into the group, rather than placed into the group without duplication. According to the docs onliine "&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="background-color: #ffffff; font-size: 17px;"&gt;addLayerToGroup&lt;/SPAN&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;method is the only way to add a layer or collection of layers to an existing, empty group layer in a layer file."&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;1) How can I select just the layers that weren't added to the group for deletion?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;2) Is there a way to go about creating a MakeNetCDFRasterLayer that doesn't add the layer to the contents pane?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Why can't we create a blank group layer using arcpy? It would seem easy to do so and this is desired, since I see StackExchange posts going back to 2011 complaining about this missing feature.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;Gabe&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2019 19:35:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/addlayertogroup/m-p/152410#M6826</guid>
      <dc:creator>GabrielMarcus1</dc:creator>
      <dc:date>2019-01-07T19:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayerToGroup</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/addlayertogroup/m-p/1280874#M68175</link>
      <description>&lt;P&gt;I know this post is a few years old, but I wanted to revive it.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Does anyone know a way to add layers to a group without duplicating them?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In the unlikely event that &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/285275"&gt;@GabrielMarcus1&lt;/a&gt; is still wondering how to make a group layer, here you go: m.createGroupLayer()&lt;/P&gt;&lt;P&gt;And here's how I like to use m.createGroupLayer() in context&lt;/P&gt;&lt;LI-CODE lang="python"&gt;if arcpy.Exists("YourGroupLayer") == False:
    m.createGroupLayer("YourGroupLayer")

lyr_to_move = "yourlayer"
    for lyr in m.listLayers(lyr_to_move):
        groupLayer = "YourGroupLayer"
        lyr =  m.listLayers(lyr_to_move)[0]
        mapGroupLayer = m.listLayers(groupLayer)[0]
        m.addLayerToGroup(mapGroupLayer, lyr)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 16:45:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/addlayertogroup/m-p/1280874#M68175</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-04-20T16:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: AddLayerToGroup</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/addlayertogroup/m-p/1280878#M68176</link>
      <description>&lt;P&gt;So this might fix the layer duplication issue, I haven't tried it yet:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/bug/the-addlayertogroup-python-function-adds-the-layer-redu-bug-000110978" target="_blank"&gt;https://support.esri.com/en-us/bug/the-addlayertogroup-python-function-adds-the-layer-redu-bug-000110978&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 16:50:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/addlayertogroup/m-p/1280878#M68176</guid>
      <dc:creator>nsidaniel</dc:creator>
      <dc:date>2023-04-20T16:50:00Z</dc:date>
    </item>
  </channel>
</rss>

