<?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: Geometry Editor - programmatically select last vertex in a polygon or polyline? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366902#M12429</link>
    <description>&lt;P&gt;Thank you again!&amp;nbsp; The reason I was asking is that I am trying to work around some odd behavior I'm seeing (200.2) when trying to insert a vertex at the end of a polyline or polygon.&amp;nbsp; My understanding is that InsertVertex inserts after the currently selected vertex or at the end, if nothing is selected.&amp;nbsp; If I interactively select a vertex that isn't the last one, then call ClearSelection(), InsertVertex() is still inserting after the vertex that &lt;EM&gt;was&lt;/EM&gt; selected prior to calling ClearSelection().&amp;nbsp; I confirmed that SelectedElement is null before calling insert.&amp;nbsp; Might be a bug.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jan 2024 18:07:09 GMT</pubDate>
    <dc:creator>Mike_Quetel</dc:creator>
    <dc:date>2024-01-05T18:07:09Z</dc:date>
    <item>
      <title>Geometry Editor - programmatically select last vertex in a polygon or polyline?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366446#M12425</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on swapping out the sketch editor with the new geometry editor. I have a need to be able to programmatically select the last vertex in the current part of a polyline or polygon geometry.&amp;nbsp; This might be necessary if the user interactively selected another vertex during the sketch.&amp;nbsp; I can't see a straightforward way to accomplish this via existing APIs.&amp;nbsp; Would appreciate a pointer from anyone who is more knowledgeable it this area.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 19:22:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366446#M12425</guid>
      <dc:creator>Mike_Quetel</dc:creator>
      <dc:date>2024-01-04T19:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry Editor - programmatically select last vertex in a polygon or polyline?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366551#M12426</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/331798"&gt;@Mike_Quetel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes, this is possible. First, determine the index of the last vertex of your multipart (polygon/polyline). Then use the&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.UI.Editing.GeometryEditor.SelectVertex.html" target="_self"&gt;SelectVertex&lt;/A&gt; method, passing in your geometry part and that last vertex index. For example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var lastVertexIndex = ((Multipart)YourGeometryEditor.Geometry).Parts[0].Count - 1;
YourGeometryEditor.SelectVertex(0, lastVertexIndex);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your calculation of lastVertexIndex might differ depending on the amount of parts of the geometry and if dealing with a polygon or polyline.&lt;/P&gt;&lt;P&gt;-William&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 22:01:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366551#M12426</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2024-01-04T22:01:38Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry Editor - programmatically select last vertex in a polygon or polyline?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366806#M12427</link>
      <description>&lt;P&gt;Appreciate the pointer in the right direction!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 15:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366806#M12427</guid>
      <dc:creator>Mike_Quetel</dc:creator>
      <dc:date>2024-01-05T15:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry Editor - programmatically select last vertex in a polygon or polyline?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366894#M12428</link>
      <description>&lt;P&gt;You are welcome! Upon consulting our geometry editor expert, a few more details to consider. You'll want to further adjust the index if it is a polygon type with current code, for example&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var indexAdjustment = geom.getGeometryType() == GeometryType.POLYLINE ? 0 : 1;&lt;/LI-CODE&gt;&lt;P&gt;and ensuring that select is not called when geometry has 0 points or index is -1. There is definitely prettier ways to refactor the code, typecasting works here but you also might consider separate cases for polygon vs polyline for easier code readability. Up to you how you would like your implementation of select last vertex &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;Feel free to post in &lt;A href="https://community.esri.com/t5/custom/page/page-id/arcgis-ideas" target="_self"&gt;ArcGIS Ideas&lt;/A&gt; if this a method you would like included in our API.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 17:54:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366894#M12428</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2024-01-05T17:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry Editor - programmatically select last vertex in a polygon or polyline?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366902#M12429</link>
      <description>&lt;P&gt;Thank you again!&amp;nbsp; The reason I was asking is that I am trying to work around some odd behavior I'm seeing (200.2) when trying to insert a vertex at the end of a polyline or polygon.&amp;nbsp; My understanding is that InsertVertex inserts after the currently selected vertex or at the end, if nothing is selected.&amp;nbsp; If I interactively select a vertex that isn't the last one, then call ClearSelection(), InsertVertex() is still inserting after the vertex that &lt;EM&gt;was&lt;/EM&gt; selected prior to calling ClearSelection().&amp;nbsp; I confirmed that SelectedElement is null before calling insert.&amp;nbsp; Might be a bug.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 18:07:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1366902#M12429</guid>
      <dc:creator>Mike_Quetel</dc:creator>
      <dc:date>2024-01-05T18:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Geometry Editor - programmatically select last vertex in a polygon or polyline?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1368036#M12444</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/331798"&gt;@Mike_Quetel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've looked into your bug and haven't been able to reproduce it on our end. Feel free to provide a reproducer and we'll gladly take another look.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 18:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/geometry-editor-programmatically-select-last/m-p/1368036#M12444</guid>
      <dc:creator>williambohrmann3</dc:creator>
      <dc:date>2024-01-09T18:54:43Z</dc:date>
    </item>
  </channel>
</rss>

