ArcObjects Library Reference (Geometry)  

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,
  double* pDistance
);
[C++]

Parameters

pOther

  pOther is a parameter of type IGeometry

pDistance [out, retval]   pDistance is a parameter of type double

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