Quantcast
Channel: Forums - ArcObjects SDKs
Viewing all articles
Browse latest Browse all 1374

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

$
0
0
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!

Code:

// 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
}


Viewing all articles
Browse latest Browse all 1374

Trending Articles