<?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 Is there any way to get the Z-Coordinate when snapping? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37152#M958</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everybody:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am writing some code to do snapping. When I snap a new point (with X and Y only) to an existing point feature (with XYZ coordinates). I will get the XY of the feature that it is snapped to, but not Z. Following is my current code. Is there anyway to identify the Z coordinate of the feature? For example, find the feature that is snapped to first, and then get Z?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;// X, Y are the mouse coordinates, get the point on the map with Lat-Long but without Z coordinate IPoint mapPoint; mapPoint = QueryMapPoint((m_application.Document as IMxDocument).ActivatedView.ScreenDisplay, X, Y);&amp;nbsp; // snap ISnappingResult snapResult = m_Snapper.FullSnap(mapPoint); if (snapResult != null) { &amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint SnappedMousePoint = snapResult.Location;&amp;nbsp;&amp;nbsp; // only get the XY, but Z=NaN }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Sep 2013 15:28:36 GMT</pubDate>
    <dc:creator>SuiHuang</dc:creator>
    <dc:date>2013-09-17T15:28:36Z</dc:date>
    <item>
      <title>Is there any way to get the Z-Coordinate when snapping?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37152#M958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everybody:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am writing some code to do snapping. When I snap a new point (with X and Y only) to an existing point feature (with XYZ coordinates). I will get the XY of the feature that it is snapped to, but not Z. Following is my current code. Is there anyway to identify the Z coordinate of the feature? For example, find the feature that is snapped to first, and then get Z?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;// X, Y are the mouse coordinates, get the point on the map with Lat-Long but without Z coordinate IPoint mapPoint; mapPoint = QueryMapPoint((m_application.Document as IMxDocument).ActivatedView.ScreenDisplay, X, Y);&amp;nbsp; // snap ISnappingResult snapResult = m_Snapper.FullSnap(mapPoint); if (snapResult != null) { &amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint SnappedMousePoint = snapResult.Location;&amp;nbsp;&amp;nbsp; // only get the XY, but Z=NaN }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 15:28:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37152#M958</guid>
      <dc:creator>SuiHuang</dc:creator>
      <dc:date>2013-09-17T15:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to get the Z-Coordinate when snapping?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37153#M959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have to admit I have never utilised any snapping objects in ArcObjects so maybe an interface does exist? If not, are you saying the geometry you are snapping to has a Z value? If so, this is one way to do it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cast your geometry into IPointCollection, cycle over this until you have the vertex you snapped to then query that vertex for a Z value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The method I am suggesting assumes you are snapping to vertices.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 12:37:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37153#M959</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2013-09-18T12:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to get the Z-Coordinate when snapping?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37154#M960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think if you make the point ZAware it should pick up the Z values automatically&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim zAware As IZAware
Set zAware = pPoint
zAware.zAware = True
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Everybody:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am writing some code to do snapping. When I snap a new point (with X and Y only) to an existing point feature (with XYZ coordinates). I will get the XY of the feature that it is snapped to, but not Z. Following is my current code. Is there anyway to identify the Z coordinate of the feature? For example, find the feature that is snapped to first, and then get Z?&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
// X, Y are the mouse coordinates, get the point on the map with Lat-Long but without Z coordinate
IPoint mapPoint;
mapPoint = QueryMapPoint((m_application.Document as IMxDocument).ActivatedView.ScreenDisplay, X, Y);

// snap
ISnappingResult snapResult = m_Snapper.FullSnap(mapPoint);
if (snapResult != null)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; IPoint SnappedMousePoint = snapResult.Location;&amp;nbsp;&amp;nbsp; // only get the XY, but Z=NaN
}
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:26:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37154#M960</guid>
      <dc:creator>JeffMatson</dc:creator>
      <dc:date>2021-12-10T21:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to get the Z-Coordinate when snapping?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37155#M961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Z snapping is only supported through the classic snapping environment. You can enable classic snapping on the UI through the editor options dialog or through the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/ClassicSnapping_Property/0020000000v8000000/" rel="nofollow" target="_blank"&gt;IEditProperties4.ClassicSnapping&lt;/A&gt;&lt;SPAN&gt; Property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The help topic &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/#/Working_with_the_editor_snap_environment/0001000004s3000000/" rel="nofollow" target="_blank"&gt;Working with the editor snap environment&lt;/A&gt;&lt;SPAN&gt; has a section on how to snap in x,y,z. Basically you enable zsnapping on feature snap agents, set the z snapping environment (&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/ISnapEnvironment3_Interface/00200000019m000000/" rel="nofollow" target="_blank"&gt;ISnapEnvironment3&lt;/A&gt;&lt;SPAN&gt;) then snap a ZAware point with &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//00200000019w000000" rel="nofollow" target="_blank"&gt;ISnapEnvironment.SnapPoint&lt;/A&gt;&lt;SPAN&gt;. We are working to make this easier in the future.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This pattern is used in the old 9.3 sample &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/39d6d81e-b497-4ce8-814b-a8d4700fe75f.htm" rel="nofollow" target="_blank"&gt;Z management properties&lt;/A&gt;&lt;SPAN&gt;. The sample has been rewritten for 10.1 as &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.arcgis.com/home/item.html?id=bb2ca737ef7f43d1a02a503c7966059d" rel="nofollow" target="_blank"&gt;Z Management Toolbar&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2013 16:52:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/is-there-any-way-to-get-the-z-coordinate-when/m-p/37155#M961</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-09-18T16:52:40Z</dc:date>
    </item>
  </channel>
</rss>

