<?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: Turn Layers off In ArcGIS Pro using Arcpy in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281760#M21716</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to use the&amp;nbsp;isBasemapLayer method -&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layer-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layer-class.htm"&gt;Layer—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Nov 2017 15:54:36 GMT</pubDate>
    <dc:creator>PeteCrosier</dc:creator>
    <dc:date>2017-11-20T15:54:36Z</dc:date>
    <item>
      <title>Turn Layers off In ArcGIS Pro using Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281757#M21713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script that should&amp;nbsp; turn off all layers in a ArcGIS Pro project. But when I run it, the following error pops up:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File "&amp;lt;string&amp;gt;", line 2, in &amp;lt;module&amp;gt;&lt;BR /&gt;IndexError: list index out of range&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the python code I am using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;p =&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt; arcpy&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;mp&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;"&gt;ArcGISProject&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;("Current&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: inherit;"&gt;"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;)
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;m &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt; p&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;listMaps&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: inherit;"&gt;"Name of map"&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;)[&lt;/SPAN&gt;&lt;SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;]
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;lyrList &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt; m&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;listLayers&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;()
&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;"&gt;for&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt; lyr &lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;"&gt;in&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt; lyrList&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;lyr&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;visible &lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"&gt; &lt;/SPAN&gt;&lt;SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;"&gt;False&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone know what I am doing wrong or missing?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:39:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281757#M21713</guid>
      <dc:creator>Business_IntelligenceSoftware</dc:creator>
      <dc:date>2021-12-11T13:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Turn Layers off In ArcGIS Pro using Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281758#M21714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simplest answer would be that the map "Name of map" doesn't exist in your project. I don't think you have to specify a map name, or you can use wildcards, if you don't always know the name.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 15:30:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281758#M21714</guid>
      <dc:creator>PeteCrosier</dc:creator>
      <dc:date>2017-11-20T15:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Turn Layers off In ArcGIS Pro using Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281759#M21715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, using the wildcard worked. However, I didn't realize it would turn off the basemap also. Do you think I could fix that using an if/else statement?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 15:39:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281759#M21715</guid>
      <dc:creator>Business_IntelligenceSoftware</dc:creator>
      <dc:date>2017-11-20T15:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Turn Layers off In ArcGIS Pro using Arcpy</title>
      <link>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281760#M21716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to use the&amp;nbsp;isBasemapLayer method -&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layer-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/layer-class.htm"&gt;Layer—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2017 15:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/turn-layers-off-in-arcgis-pro-using-arcpy/m-p/281760#M21716</guid>
      <dc:creator>PeteCrosier</dc:creator>
      <dc:date>2017-11-20T15:54:36Z</dc:date>
    </item>
  </channel>
</rss>

