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


IProximityOperator3D.ReturnDistance3D 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.ReturnDistance3D Method
ArcGIS Developer Help

IProximityOperator3D.ReturnDistance3D Method

Returns the minimal distance between two geometries.

[Visual Basic .NET]
Public Function ReturnDistance3D ( _
    ByVal pOther As IGeometry _
) As Double
[C#]
public double ReturnDistance3D (
    IGeometry pOther
);
[C++]
HRESULT ReturnDistance3D(
  IGeometry* pOther
);
[C++]
Parameters
pOther 

pOther is a parameter of type IGeometry*

Product Availability

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

Description

Returns the minimum distance between two z aware geometries in 3D space.  If the geometries intersect, the minimum distance is 0.  Only returns the distance, and not the nearest points.

[C#]

 

 

        public static void ReturnDistance3D()

        {

               IGeometry pointGeometry = GetPointGeometry();

               IGeometry envelopeGeometry = GetEnvelopeGeometry();


               IProximityOperator3D
 proximityOperator3D = envelopeGeometry as IProximityOperator3D;

               double distance3D = proximityOperator3D.ReturnDistance3D(pointGeometry);

               //distance3D = 13.971

        }

See Also

IProximityOperator3D Interface