<?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 Arcpy Exist Gives Inconsistent results in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-exist-gives-inconsistent-results/m-p/428136#M33634</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since upgrading from 10.2 to 10.6 one of my scripts no longer works when it tries to use the CollectEvents tool. It has an issue reaching one of the layers saying it doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure enough, arcpy.Exists() returns False BUT the layer is grabbed using ListLayers() and it is one of two layers. I notice that if the layer is copied in two data frames, ListLayers() will grab both layers, but Exists() will only return True for one of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can reproduce this issue with a new document and completely different datasets:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/487005_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a known bug or am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2020 18:35:28 GMT</pubDate>
    <dc:creator>succip</dc:creator>
    <dc:date>2020-03-31T18:35:28Z</dc:date>
    <item>
      <title>Arcpy Exist Gives Inconsistent results</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exist-gives-inconsistent-results/m-p/428136#M33634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since upgrading from 10.2 to 10.6 one of my scripts no longer works when it tries to use the CollectEvents tool. It has an issue reaching one of the layers saying it doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sure enough, arcpy.Exists() returns False BUT the layer is grabbed using ListLayers() and it is one of two layers. I notice that if the layer is copied in two data frames, ListLayers() will grab both layers, but Exists() will only return True for one of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can reproduce this issue with a new document and completely different datasets:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/487005_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a known bug or am I doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 18:35:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exist-gives-inconsistent-results/m-p/428136#M33634</guid>
      <dc:creator>succip</dc:creator>
      <dc:date>2020-03-31T18:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Exist Gives Inconsistent results</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-exist-gives-inconsistent-results/m-p/428137#M33635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What you are showing/seeing with the example is expected, at least in terms of Esri's documentation.&amp;nbsp; Since you are not passing a dataframe object to ListLayers, you are getting the layers from all dataframes.&amp;nbsp; According to the &lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/exists.htm" title="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/exists.htm"&gt;Exists—Help | Documentation&lt;/A&gt;:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="font-size: 0.875rem; line-height: 1.71429em; margin-top: 0em; margin-bottom: 1.71429em; -webkit-font-smoothing: antialiased;"&gt;Layers in a stand-alone script and layers in an active map can be used as input to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="" style="-webkit-font-smoothing: antialiased; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-weight: bold;"&gt;Exists&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So, ListLayers should list all layers (given your arguments) and Exists should only evaluate layers that are part of the second map.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:34:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-exist-gives-inconsistent-results/m-p/428137#M33635</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-03-31T21:34:58Z</dc:date>
    </item>
  </channel>
</rss>

