<?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 Add layer group with multiple layers and persist in table of contents in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/add-layer-group-with-multiple-layers-and-persist/m-p/167833#M1010</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN lang="en" style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;I am programming a pyhton tool whose purpose is to add a group of layers with several layers to the current mxd.
I am migrating a pyhton script to a pyhton toolbox. When I run the script, the layers are added to the TOC and they persist,
but when I run the python tool, I see that the layers are added to the table of contents and when the tool ends correctly,
this group of layers and the layers it contains disappear.
I've been researching in the community and using a derived parameter and &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;SetParameterAsText() funtion,&lt;/SPAN&gt; the only thing
I get is that the layer group persists in the TOC, but not the layers that this group has.

Can somebody help me, please?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:44:35 GMT</pubDate>
    <dc:creator>SilviaP</dc:creator>
    <dc:date>2021-12-11T08:44:35Z</dc:date>
    <item>
      <title>Add layer group with multiple layers and persist in table of contents</title>
      <link>https://community.esri.com/t5/developers-questions/add-layer-group-with-multiple-layers-and-persist/m-p/167833#M1010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN lang="en" style="font-size: 15px; font-family: arial, helvetica, sans-serif;"&gt;I am programming a pyhton tool whose purpose is to add a group of layers with several layers to the current mxd.
I am migrating a pyhton script to a pyhton toolbox. When I run the script, the layers are added to the TOC and they persist,
but when I run the python tool, I see that the layers are added to the table of contents and when the tool ends correctly,
this group of layers and the layers it contains disappear.
I've been researching in the community and using a derived parameter and &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;SetParameterAsText() funtion,&lt;/SPAN&gt; the only thing
I get is that the layer group persists in the TOC, but not the layers that this group has.

Can somebody help me, please?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:44:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/add-layer-group-with-multiple-layers-and-persist/m-p/167833#M1010</guid>
      <dc:creator>SilviaP</dc:creator>
      <dc:date>2021-12-11T08:44:35Z</dc:date>
    </item>
  </channel>
</rss>

