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


ISegmentCollection.ReplaceSegments Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IS > ISegmentCollection Interface > ISegmentCollection.ReplaceSegments Method
ArcGIS Developer Help

ISegmentCollection.ReplaceSegments Method

Removes and inserts from segments. This method is intended for internal use only.

[Visual Basic .NET]
Public Sub ReplaceSegments ( _
    ByVal Index As Integer, _
    ByVal comingIn As Integer, _
    ByVal goingAway As Integer, _
    ByRef newSegments As ISegment _
)
[C#]
public void ReplaceSegments (
    int Index,
    int comingIn,
    int goingAway,
    ref ISegment newSegments
);
[C++]
HRESULT ReplaceSegments(
  long Index,
  long comingIn,
  long goingAway,
  ISegment** newSegments
);
[C++]
Parameters
Index 

Index is a parameter of type long comingIn
comingIn is a parameter of type long goingAway
goingAway is a parameter of type long newSegments
newSegments is a parameter of type ISegment**

Product Availability

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

Description

Removes a specified number (goingAway) of Segments from a Segment Collection starting at a given index and replaces them (starting at the same index) with a specified number (comingIn) of Segments from an array of Segments.

Remarks

ReplaceSegments will return an error ("The index is either too large or too small") if the inputs are inconsistent. For example, specifying index = 4 on a polyline with only 2 segments.

On multipart geometry, segments cannot be replaced on more than one part at the time. For example, an error (("The index is either too large or too small") is returned on a polyline with two parts containing three segments each when specifying index= 2, incoming= 2, removal= 2. The error is returned because the first part doesn't contain enough segments to remove two segments starting at index = 2. This behavior is enforced for performance reasons. Please see the example.  

[C#]

When using C# you must use the IGeometryBridge interface to call this method.

[Visual Basic .NET]

When using VBNET you must use the IGeometryBridge interface to call this method.

See Also

ISegmentCollection Interface