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


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

IGeometryBridge.SetSegments Method

Replaces all segments with references to the input segments.

[Visual Basic .NET]
Public Sub SetSegments ( _
    ByVal pSegmentCollection As ISegmentCollection, _
    ByRef newSegments As ISegment[] _
)
[C#]
public void SetSegments (
    ISegmentCollection pSegmentCollection,
    ref ISegment[] newSegments
);
[C++]
HRESULT SetSegments(
  ISegmentCollection* pSegmentCollection,
  Array* newSegments
);
[C++]

Parameters pSegmentCollection [in]
pSegmentCollection is a parameter of type ISegmentCollection newSegments [in] newSegments is a parameter of type Array

Product Availability

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

Description

All development languages compatible version of ISegmentCollection::SetSegments .

[C#]

    public static void SetSegments(ISegment[] segmentArray)
    {
        ISegmentCollection segmentCollection=new PolylineClass();
        //adds Segments to segmentCollection
        IGeometryBridge geometryBridge=new GeometryEnvironmentClass();
        geometryBridge.AddSegments(segmentCollection, ref segmentArray);
        int insertLength=5;
        ISegment[] insertSegmentArray=new ISegment[insertLength];

        for (int i=0; i < insertLength; i++)
        {
            ILine insertLine=new LineClass();
            IPoint insertFromPoint=new PointClass();
            insertFromPoint.PutCoords(i * 666, i * 666);
            IPoint insertToPoint=new PointClass();
            insertToPoint.PutCoords(i * 333, i * 333);
            insertLine.PutCoords(insertFromPoint, insertToPoint);
            insertSegmentArray[i]=insertLine as ISegment;
        }
        geometryBridge.SetSegments(segmentCollection, ref insertSegmentArray);
    }

See Also

IGeometryBridge Interface