<?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 listLayer randomly can't find any names in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/listlayer-randomly-can-t-find-any-names/m-p/1276506#M67374</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;                        lyrList = map.listLayers()
                        for lyr in lyrList:
                            if  lyr.supports("NAME"):
                                if "Hillshade" in lyr.name or lyr.name == "temp":
                                    map.removeLayer(lyr)
                                # if lyr.name == "Lift Stations":
                                #     insertrows(map, lyr, ski_run_query_lyr)
                                #     insertrows(map, "ski_run_query", lift_query_lyr)
                                if  lyr.name =="Building Centroid":
                                    insertrows(map, resort_feature_query_lyr)
                                    insertrows(map, resort_feature_resort_lyr)
                                    insertrows(map, building_lyr)
                                    insertrows(map, building_other_lyr)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-04-07 at 7.08.50 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67474i7292E42216BF8F20/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-04-07 at 7.08.50 AM.png" alt="Screenshot 2023-04-07 at 7.08.50 AM.png" /&gt;&lt;/span&gt;The first run of my script every time comes up with attribute "name" not supported on the layers. They make it through the name check but then fail. Has anyone else seen this.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Apr 2023 12:14:42 GMT</pubDate>
    <dc:creator>AnonymousUser23</dc:creator>
    <dc:date>2023-04-07T12:14:42Z</dc:date>
    <item>
      <title>listLayer randomly can't find any names</title>
      <link>https://community.esri.com/t5/python-questions/listlayer-randomly-can-t-find-any-names/m-p/1276506#M67374</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;                        lyrList = map.listLayers()
                        for lyr in lyrList:
                            if  lyr.supports("NAME"):
                                if "Hillshade" in lyr.name or lyr.name == "temp":
                                    map.removeLayer(lyr)
                                # if lyr.name == "Lift Stations":
                                #     insertrows(map, lyr, ski_run_query_lyr)
                                #     insertrows(map, "ski_run_query", lift_query_lyr)
                                if  lyr.name =="Building Centroid":
                                    insertrows(map, resort_feature_query_lyr)
                                    insertrows(map, resort_feature_resort_lyr)
                                    insertrows(map, building_lyr)
                                    insertrows(map, building_other_lyr)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-04-07 at 7.08.50 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67474i7292E42216BF8F20/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-04-07 at 7.08.50 AM.png" alt="Screenshot 2023-04-07 at 7.08.50 AM.png" /&gt;&lt;/span&gt;The first run of my script every time comes up with attribute "name" not supported on the layers. They make it through the name check but then fail. Has anyone else seen this.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 12:14:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listlayer-randomly-can-t-find-any-names/m-p/1276506#M67374</guid>
      <dc:creator>AnonymousUser23</dc:creator>
      <dc:date>2023-04-07T12:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: listLayer randomly can't find any names</title>
      <link>https://community.esri.com/t5/python-questions/listlayer-randomly-can-t-find-any-names/m-p/1276602#M67377</link>
      <description>&lt;P&gt;It seems like supports() is giving a false positive.&amp;nbsp; I would try and catch the specific layer causing the issue in a try except block initially as that might help you figure out the cause.&lt;BR /&gt;I'd also avoid using map as an object name as it could cause confusion, but that's just my opinion.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 16:24:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listlayer-randomly-can-t-find-any-names/m-p/1276602#M67377</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2023-04-07T16:24:19Z</dc:date>
    </item>
  </channel>
</rss>

