<?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: Search Cursor not honoring selection  in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183491#M8137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you set your workspace just to be sure&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/get-count.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/get-count.htm"&gt;Get Count—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it is a layer or table view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;If the input is a layer or table view containing a selected set of records, only the selected records will be counted.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Mar 2020 22:36:18 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2020-03-10T22:36:18Z</dc:date>
    <item>
      <title>Search Cursor not honoring selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183489#M8135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ArcGIS Pro 2.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have made a manual selection of 38 polygons (of 240,000).&amp;nbsp; In the python window of my project, I run a search cursor that looks like this:&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ng&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'USNG'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And it prints the row until the cows come home.&amp;nbsp; I found this post from last year:&amp;nbsp;&lt;A href="https://community.esri.com/thread/231672" target="_blank"&gt;Why is Search Cursor not honoring layer Selection?&lt;/A&gt;&amp;nbsp;but it's about selections being made outside of Pro.&amp;nbsp; I just ran GetCount () and it returns all the records.&amp;nbsp; What the heck is going on?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="484708" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/484708_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:20:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183489#M8135</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T09:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor not honoring selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183490#M8136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where is ng being defined?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183490#M8136</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-03-10T22:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor not honoring selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183491#M8137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you set your workspace just to be sure&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/get-count.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/get-count.htm"&gt;Get Count—Data Management toolbox | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it is a layer or table view?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; background-color: #ffffff;"&gt;If the input is a layer or table view containing a selected set of records, only the selected records will be counted.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 22:36:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183491#M8137</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-10T22:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor not honoring selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183492#M8138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ng is defined earlier as&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;r'Drive:\path\to\a\featureclass\named\NationalGrid'‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And that my friends is the root of the problem.&amp;nbsp; I insert the variable name, so it's looking at whats out there on disc, not the feature layer ArcGIS Pro has selected in the project. Same holds true for Get Count.&amp;nbsp; When I let arcgis pro add the feature class or table name from the toc all is well.&amp;nbsp; Although when I type in arcpy.getcount, it auto completes it the slightly different syntax of:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;arcpy.management.GetCount('WesternTiles')
&amp;lt;Result '2'&amp;gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;in this case I'm inserting the suggested table (view) name of WesternTiles, which I have two records selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks-&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:20:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183492#M8138</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T09:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor not honoring selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183493#M8139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And that is knowledge wrap for today folks... &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2020 23:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183493#M8139</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-03-10T23:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Search Cursor not honoring selection</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183494#M8140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep!&amp;nbsp; My problem (at least on of them) is I spend more time in Spyder than than I do in Pro and have variables on the brain...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2020 00:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/search-cursor-not-honoring-selection/m-p/183494#M8140</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2020-03-11T00:54:17Z</dc:date>
    </item>
  </channel>
</rss>

