This document is archived and information here might be outdated.  Recommended version.


IProximityOperator3D.ReturnNearestPoint3D Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IP > IProximityOperator3D Interface > IProximityOperator3D.ReturnNearestPoint3D Method
ArcGIS Developer Help

IProximityOperator3D.ReturnNearestPoint3D Method

Creates and returns a point on this geometry nearest to the input point.

[Visual Basic .NET]
Public Function ReturnNearestPoint3D ( _
    ByVal pInP As IPoint, _
    ByVal extension As esriSegmentExtension _
) As IPoint
[C#]
public IPoint ReturnNearestPoint3D (
    IPoint pInP,
    esriSegmentExtension extension
);
[C++]
HRESULT ReturnNearestPoint3D(
  IPoint* pInP,
  esriSegmentExtension extension
);
[C++]
Parameters
pInP 

pInP is a parameter of type IPoint* extension
extension is a parameter of type esriSegmentExtension

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Finds and returns the nearest point, in 3D space, on a z aware geometry to the input point.  Depending on the method of segment extension, the nearest point can also be found on an extension of the geometry.

Remarks

If the geometry is an Envelope and the input point is located within the bounds of the Envelope, QueryNearestPoint3D will return a point on the exterior of the Envelope nearest the input point.

[C#]

 

        public static void ReturnNearestPoint3D()

        {

               IGeometry pointGeometry = GetPointGeometry();

               IGeometry envelopeGeometry = GetEnvelopeGeometry();


               IProximityOperator3D
 proximityOperator3D = envelopeGeometry as IProximityOperator3D;

               IPoint nearestPoint3D = proximityOperator3D.ReturnNearestPoint3D(pointGeometry as IPoint, esriSegmentExtension.esriNoExtension);

               //nearestPoint3D = (5.393, -0.583, -6.043)

        }

See Also

IProximityOperator3D Interface