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

IGeometryBridge2.SplitAtDistances Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryBridge2 Interface > IGeometryBridge2.SplitAtDistances Method
ArcGIS Developer Help

IGeometryBridge2.SplitAtDistances Method

Introduces new vertices into this polyline at specified distances from the beginning of the polyline.

[Visual Basic .NET]
Public Function SplitAtDistances ( _
    ByVal polyCurve As IPolycurve2, _
    ByRef distances As Double[]&, _
    ByVal asRatios As Boolean, _
    ByVal createParts As Boolean _
) As IEnumSplitPoint
public IEnumSplitPoint SplitAtDistances (
    IPolycurve2 polyCurve,
    ref Double[]& distances,
    ref bool asRatios,
    ref bool createParts
HRESULT SplitAtDistances(
  IPolycurve2* polyCurve,
  SAFEARRAY(System.Double)* distances,
  VARIANT_BOOL asRatios,
  VARIANT_BOOL createParts
polyCurve [in]

polyCurve is a parameter of type IPolycurve2* distances [in]
distances is a parameter of type SAFEARRAY(double)* asRatios [in]
asRatios is a parameter of type bool createParts [in]
createParts is a parameter of type bool

Product Availability

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

    public void SplitAtDistances()
        //Construct Polycurve
        IPoint fromPoint = new PointClass();
        fromPoint.PutCoords(0, 0);
        IPoint toPoint = new PointClass();
        toPoint.PutCoords(100, 0);
        IPolycurve2 polyCurve = new PolylineClass();
        polyCurve.FromPoint = fromPoint;
        polyCurve.ToPoint = toPoint;

        //split in 10 parts using absolute length, therefore asRatio = false
        bool asRatio = false;
        double[] distances = new double[10];
        for (int i = 0; i < 10; i++)
            distances[i] = (polyCurve.Length / 100) * (i + 1) * 10;
        IGeometryBridge2 geometryBridge = new GeometryEnvironmentClass();
        IEnumSplitPoint splitPoints = geometryBridge.SplitAtDistances(polyCurve, ref distances, asRatio, true);
        //print splitPoints
        IPoint currentPoint;
        int partIndex;
        int vertexIndex;
        splitPoints.Next(out currentPoint, out partIndex, out vertexIndex);
        while (currentPoint != null)
            System.Windows.Forms.MessageBox.Show("X = " + currentPoint.X + " ,Y = " + currentPoint.Y);
            splitPoints.Next(out currentPoint, out partIndex, out vertexIndex);

See Also

IGeometryBridge2 Interface