<?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: GetFeatures returning empty SelectionSet from point geometry in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getfeatures-returning-empty-selectionset-from/m-p/1594331#M12725</link>
    <description>&lt;P&gt;That was exactly it. Thank you so much for the help - I would have taken forever to think to try that.&lt;/P&gt;&lt;P&gt;I was able to fix the issue by modifying the tool's OnToolActivateAsync method to ensure the chosen layer is selectable (the 'working' layer is set by the user and stored in the add-in module):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    internal class PrescriptionBrush : MapTool
    {
        protected override async Task OnToolActivateAsync(bool active)
        {
            if (WoodlandsManager.Current.CurrentPlan == null)
            {
                MessageBox.Show("No current plan is selected in the ribbon. Please select a plan to assign prescriptions to.");
                await FrameworkApplication.SetCurrentToolAsync(null);
                return;
            }
            else
            {
                await QueuedTask.Run(() =&amp;gt;
                {
                    WoodlandsManager.Current.CurrentPlan.SetSelectable(true);
                });

                return;
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works great now. Thank you again!&lt;/P&gt;</description>
    <pubDate>Tue, 11 Mar 2025 16:13:53 GMT</pubDate>
    <dc:creator>NalbertTero</dc:creator>
    <dc:date>2025-03-11T16:13:53Z</dc:date>
    <item>
      <title>GetFeatures returning empty SelectionSet from point geometry</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getfeatures-returning-empty-selectionset-from/m-p/1594260#M12722</link>
      <description>&lt;P&gt;Hello all -&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am stymied by a simple error that I cannot resolve. I have a map tool that will be used to change an attribute value of a feature with each click. In testing, the sketch geometry is created correctly, and the tool's OnSketchCompleteAsync method fires as well. However, when passing the sketch geometry to MapView.Active.GetFeatures returns an empty SelectionSet every time, not matter where I click on the map.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        protected override async Task&amp;lt;bool&amp;gt; OnSketchCompleteAsync(Geometry geometry)
        {
            var mapView = MapView.Active;

            await QueuedTask.Run(() =&amp;gt;
            {
                var intersectedFeatures = mapView.GetFeatures(geometry);

                if (!intersectedFeatures.IsEmpty) // This clause is never reached.
                {
                    mapView.FlashFeature(intersectedFeatures);

                    if (intersectedFeatures.Contains(WoodlandsManager.Current.CurrentPlan))
                    {
                        var plan_feature = intersectedFeatures[WoodlandsManager.Current.CurrentPlan].FirstOrDefault();

                        Inspector inspector = new Inspector();

                        inspector.Load(WoodlandsManager.Current.CurrentPlan, plan_feature);
                        inspector["Prescription"] = _prescription;

                        EditOperation editOperation = new EditOperation();
                        editOperation.Modify(inspector);
                        editOperation.Execute();
                    }
                }
                else // This clause always is.
                {
                    MessageBox.Show("No features at the point you clicked.");
                }
            });
            return true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; I have tried using SketchGeometryType.Point, Polygon, and Line, and&amp;nbsp;SketchOutputMode.Screen and Map.&lt;/P&gt;&lt;P&gt;Any suggestions on why the empty SelectionSet would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 14:29:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getfeatures-returning-empty-selectionset-from/m-p/1594260#M12722</guid>
      <dc:creator>NalbertTero</dc:creator>
      <dc:date>2025-03-11T14:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: GetFeatures returning empty SelectionSet from point geometry</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getfeatures-returning-empty-selectionset-from/m-p/1594318#M12723</link>
      <description>&lt;P&gt;By any chance, could your layers be set to be "un selectable"? It is a setting that you can see in the table of contents. Like the screenshot:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UmaHarano_2-1741708236297.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/127642i44AA9DFA9DCFB3DB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UmaHarano_2-1741708236297.png" alt="UmaHarano_2-1741708236297.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 15:51:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getfeatures-returning-empty-selectionset-from/m-p/1594318#M12723</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2025-03-11T15:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: GetFeatures returning empty SelectionSet from point geometry</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/getfeatures-returning-empty-selectionset-from/m-p/1594331#M12725</link>
      <description>&lt;P&gt;That was exactly it. Thank you so much for the help - I would have taken forever to think to try that.&lt;/P&gt;&lt;P&gt;I was able to fix the issue by modifying the tool's OnToolActivateAsync method to ensure the chosen layer is selectable (the 'working' layer is set by the user and stored in the add-in module):&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    internal class PrescriptionBrush : MapTool
    {
        protected override async Task OnToolActivateAsync(bool active)
        {
            if (WoodlandsManager.Current.CurrentPlan == null)
            {
                MessageBox.Show("No current plan is selected in the ribbon. Please select a plan to assign prescriptions to.");
                await FrameworkApplication.SetCurrentToolAsync(null);
                return;
            }
            else
            {
                await QueuedTask.Run(() =&amp;gt;
                {
                    WoodlandsManager.Current.CurrentPlan.SetSelectable(true);
                });

                return;
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works great now. Thank you again!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 16:13:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/getfeatures-returning-empty-selectionset-from/m-p/1594331#M12725</guid>
      <dc:creator>NalbertTero</dc:creator>
      <dc:date>2025-03-11T16:13:53Z</dc:date>
    </item>
  </channel>
</rss>

