<?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: Can a MapTool snap to a line? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791206#M1541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great.&amp;nbsp; Thanks &lt;A href="https://community.esri.com/migrated-users/3324"&gt;Sean Jones&lt;/A&gt;‌.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another related question:&amp;nbsp; Is it possible to snap to a graphic that is drawn on the screen?&amp;nbsp; In my case, I have a tool that creates graphics along of a sewer segment to show where residential sewer connections are coming into the pipe (red graphics).&amp;nbsp; Ideally I would be able to snap to these red graphics and not just the line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/502267_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2020 13:48:33 GMT</pubDate>
    <dc:creator>BrianBulla</dc:creator>
    <dc:date>2020-08-04T13:48:33Z</dc:date>
    <item>
      <title>Can a MapTool snap to a line?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791204#M1539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm creating a MapTool and I need it to be able to snap to a line.&amp;nbsp; Within Pro, I have edge snapping 'enabled' and snapping turned on.&amp;nbsp; I also have Snapping turn on through the code in the MapTool, but either way I cannot get the little 'cross hair' cursor to snap to anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where am I going wrong with this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;        &lt;SPAN class="keyword token"&gt;protected&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;override&lt;/SPAN&gt; Task &lt;SPAN class="token function"&gt;OnToolActivateAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;bool&lt;/SPAN&gt; active&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            
            Snapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IsEnabled &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            Snapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetSnapMode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SnapMode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Edge&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            Snapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;SetSnapMode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SnapMode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;End&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&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;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;base&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;OnToolActivateAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;active&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:04:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791204#M1539</guid>
      <dc:creator>BrianBulla</dc:creator>
      <dc:date>2021-12-12T09:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can a MapTool snap to a line?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791205#M1540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Brian,&lt;/P&gt;&lt;P&gt;The UseSnapping property on maptool determines if the tool will use the snap environment.&lt;/P&gt;&lt;P&gt;You would normally set this to True in the tools constructor. Its False by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;    &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;SketchSelect&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;
      IsSketchTool &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      SketchType &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SketchGeometryType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Line&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      SketchOutputMode &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SketchOutputMode&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
      UseSnapping &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:04:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791205#M1540</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T09:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can a MapTool snap to a line?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791206#M1541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great.&amp;nbsp; Thanks &lt;A href="https://community.esri.com/migrated-users/3324"&gt;Sean Jones&lt;/A&gt;‌.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another related question:&amp;nbsp; Is it possible to snap to a graphic that is drawn on the screen?&amp;nbsp; In my case, I have a tool that creates graphics along of a sewer segment to show where residential sewer connections are coming into the pipe (red graphics).&amp;nbsp; Ideally I would be able to snap to these red graphics and not just the line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/502267_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 13:48:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791206#M1541</guid>
      <dc:creator>BrianBulla</dc:creator>
      <dc:date>2020-08-04T13:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can a MapTool snap to a line?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791207#M1542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Brian,&lt;/P&gt;&lt;P&gt;Graphics created with the AddOverlay methods&amp;nbsp;cant be snapped too, they arent in the snapping cache. We do want to add this in a future release.&lt;/P&gt;&lt;P&gt;You can look into &lt;A href="https://pro.arcgis.com/en/pro-app/help/mapping/layer-properties/graphics-layers.htm"&gt;graphics layers&lt;/A&gt;, which are new at 2.6, that lets users draw persisted snappable graphics and its &lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-GraphicsLayers"&gt;API&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 20:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791207#M1542</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-04T20:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can a MapTool snap to a line?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791208#M1543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great.&amp;nbsp; Yes, I haven't updated my code since 2.6 came out, so I will look into graphics layers and see if that fixes my problem.&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, 06 Aug 2020 16:56:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/can-a-maptool-snap-to-a-line/m-p/791208#M1543</guid>
      <dc:creator>BrianBulla</dc:creator>
      <dc:date>2020-08-06T16:56:18Z</dc:date>
    </item>
  </channel>
</rss>

