AnsweredAssumed Answered

Is there any way to get the Z-Coordinate when snapping?

Question asked by huangs3 on Sep 17, 2013
Latest reply on Sep 18, 2013 by sean_jones-esristaff
Hi Everybody:

    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?

    Thank you!

// 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) {     IPoint SnappedMousePoint = snapResult.Location;   // only get the XY, but Z=NaN }

Outcomes