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


IGeometryBridge.QueryWKSPointZs Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Geometry)  

IGeometryBridge.QueryWKSPointZs Method

Copies vertices/points coordinates to the array of point structures.

[Visual Basic .NET]
Public Sub QueryWKSPointZs ( _
    ByVal pPointCollection As IPointCollection4, _
    ByVal Index As Integer, _
    ByRef pointStructures As WKSPointZ[] _
)
[C#]
public void QueryWKSPointZs (
    IPointCollection4 pPointCollection,
    int Index,
    ref WKSPointZ[] pointStructures
);
[C++]
HRESULT QueryWKSPointZs(
  IPointCollection4* pPointCollection,
  long Index,
  Array* pointStructures
);
[C++]

Parameters pPointCollection [in]
pPointCollection is a parameter of type IPointCollection4 Index Index is a parameter of type long pointStructures [in, out] pointStructures is a parameter of type Array

Product Availability

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

Description

All development languages compatible version of IPointCollection4::QueryWKSPointsZs .

[C#]     public void QueryWKSPointZs()
    {
        int length=10;
        WKSPointZ[] pointArray=new WKSPointZ[length];
        for (int i=0; i < length; i++)
        {
            pointArray[i]=new WKSPointZ();
            pointArray[i].X=i * 10;
            pointArray[i].Y=i * 10;
            pointArray[i].Z=i * 10;
        }
        IPointCollection4 pointCollection=new MultipointClass();
        //adds WKSpointZs to pointCollection   I
        IGeometryBridge geometryBridge=new GeometryEnvironmentClass();
        geometryBridge.AddWKSPointZs(pointCollection, ref pointArray);
        //prepare output
        int index=0;
        WKSPointZ[] outPutPointArray=new WKSPointZ[pointCollection.PointCount - index];
        for (int i=0; i < outPutPointArray.Length; i++)
        {
            outPutPointArray[i]=new WKSPointZ();
        }
        //query
        geometryBridge.QueryWKSPointZs(pointCollection, index, ref outPutPointArray);
        String report="";
        for (int i=0; i < outPutPointArray.Length; i++)
        {
            WKSPointZ currentPoint=outPutPointArray[i];
            report=report + "index=" + i + " ,X=" + currentPoint.X + " ,Y=" + currentPoint.Y + " ,Z=" + currentPoint.Z + "\n";
        }
        System.Windows.Forms.MessageBox.Show(report);
    }

See Also

IGeometryBridge Interface