<?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: Selection to Feature in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167403#M8062</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to get cursor from selection:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;                    using (var rowCursor = gsSelection.Search(null))
                    {
                        while (rowCursor.MoveNext())
                        {
                            using (var polyFeature2 = rowCursor.Current as Feature)
                            {
                                // Your code here
                            }
                        }
                    }&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 25 Apr 2022 08:58:02 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2022-04-25T08:58:02Z</dc:date>
    <item>
      <title>Selection to Feature</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167387#M8061</link>
      <description>&lt;P&gt;Good day,&lt;BR /&gt;is there any way to make Selection a Feature? It may be primitive, but I'm not sure.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var gsSelection = lyrList.GetSelection();
                    var polyFeature2 = gsSelection as Feature;//here is the error: Cannot convert type 'ArcGIS.Core.Data.Selection' to 'ArcGIS.Core.Data.Feature' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion	
                    var polygonGeometry2 = polyFeature2.GetShape() as Polygon;
                    var mapPoint1 = GeometryEngine.Instance.Centroid(polygonGeometry2);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 07:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167387#M8061</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-04-25T07:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Selection to Feature</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167403#M8062</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need to get cursor from selection:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;                    using (var rowCursor = gsSelection.Search(null))
                    {
                        while (rowCursor.MoveNext())
                        {
                            using (var polyFeature2 = rowCursor.Current as Feature)
                            {
                                // Your code here
                            }
                        }
                    }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 25 Apr 2022 08:58:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167403#M8062</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-04-25T08:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Selection to Feature</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167421#M8063</link>
      <description>&lt;P&gt;And is it possible to use while-LOOP for only one pass?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 10:53:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167421#M8063</guid>
      <dc:creator>DavidMrázek</dc:creator>
      <dc:date>2022-04-25T10:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Selection to Feature</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167424#M8064</link>
      <description>&lt;P&gt;I don't know what you exactly mean "&lt;SPAN&gt;use while-LOOP for only one pass". If you want to get only one feature, you can change "while" to "if". If you want to go through selection few times, so you need each time make new search. Cursor works one time only&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 10:59:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/selection-to-feature/m-p/1167424#M8064</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2022-04-25T10:59:58Z</dc:date>
    </item>
  </channel>
</rss>

