<?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: Update cursor in ArcGIS Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-cursor-in-arcgis-pro-sdk/m-p/843223#M3953</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is exactly what I was looking for, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2019 18:58:50 GMT</pubDate>
    <dc:creator>TimWitt2</dc:creator>
    <dc:date>2019-06-13T18:58:50Z</dc:date>
    <item>
      <title>Update cursor in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-cursor-in-arcgis-pro-sdk/m-p/843221#M3951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I have a feature layer from which I want to select features that have a certain value and then delete them.&lt;/P&gt;&lt;P&gt;With arcpy it&amp;nbsp; was quiet easy, I would use the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor( "C:\\topo.gdb\\DangleErrors_buffer_join", "Join_Count") as cursor:&lt;BR /&gt;&amp;nbsp; for row in cursor:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if row[0] == 1:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; cursor.deleteRow()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How would I do this with the ArcGISPro SDK?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 15:29:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-cursor-in-arcgis-pro-sdk/m-p/843221#M3951</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2019-06-13T15:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-cursor-in-arcgis-pro-sdk/m-p/843222#M3952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tim,&lt;/P&gt;&lt;P&gt;There's a few ways you can do this, as always.&lt;/P&gt;&lt;P&gt;The &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geodatabase#deleting-a-rowfeature" rel="nofollow noopener noreferrer" target="_blank"&gt;delete row/feature snippet&lt;/A&gt; shows an example of using a row cursor within an edit operation callback. This would be used if the feature class/table wasn't in the map.&lt;/P&gt;&lt;P&gt;You can also use a simple edit operation delete with a list of oids from a queryfilter.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;      QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
      &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;//find the layer in the map&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; streams &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Active&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetLayersAsFlattenedList&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FirstOrDefault&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;l &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; l&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Streams"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="comment token"&gt;//queryfilter and selection&lt;/SPAN&gt;
        QueryFilter queryFilter &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;QueryFilter&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; WhereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"FType = 460"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; selection &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; streams&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetTable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Select&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;queryFilter&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SelectionType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ObjectID&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SelectionOption&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Normal&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

        &lt;SPAN class="comment token"&gt;//edit operation&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; op &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;EditOperation&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        op&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Delete with queryfilter"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        op&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Delete&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;streams&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;selection&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GetObjectIDs&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        op&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Execute&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&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;&lt;/P&gt;&lt;P&gt;You could also iterate through a rowcursor (table.search) to get the OID's and feed those into delete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:19:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-cursor-in-arcgis-pro-sdk/m-p/843222#M3952</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T10:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update cursor in ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-cursor-in-arcgis-pro-sdk/m-p/843223#M3953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is exactly what I was looking for, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 18:58:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/update-cursor-in-arcgis-pro-sdk/m-p/843223#M3953</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2019-06-13T18:58:50Z</dc:date>
    </item>
  </channel>
</rss>

