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

IPolyline.Reshape Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IP > IPolyline Interface > IPolyline.Reshape Method
ArcGIS Developer Help

IPolyline.Reshape Method

Modifies this polyline by replacing some of its segments with some segments from reshapeSource.

[Visual Basic .NET]
Public Function Reshape ( _
    ByVal reshapeSource As IPath _
) As Boolean
public bool Reshape (
    IPath reshapeSource
HRESULT Reshape(
  IPath* reshapeSource

reshapeSource is a parameter of type IPath*

Product Availability

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


Reshape replaces the Segments in the Polyline between consecutive Intersections with the input Path segments that connect those intersections.  Reshape returns a boolean indicating whether or not a modification to the Polyline occurred.

Algorithm of Reshape method is described below:

1. Find the intersections of the Reshape path with the polyline parts. Select two intersection points: The first one to be closest to the one end of the Reshape path, and the second one to be closest to the other end of the Reshape path.

2. If both intersecion points belong to the same part of the polyline, replace all the segments of the Polyline part between the selected intersection points with the subcurve of the Reshape path that is between the selected intersecion points.

3. If the selected intersection points belong to the different parts of the polyline, then connect the part of the polyline with the subcurve of the reshape path and get rid of the superflous segments of the parts:

a. for the first selected intersecting part (in the stored part order), get rid of all segments after the selected intersection,

b. for the other selected intersecting part, get rid of all segments before the selected intersection point.

Leave the parts that are between the selected intersecting parts intact, even if they intersect the Reshape path.

Direction of the Reshape path does not matter and can change. The order of the parts is preserved.

Result is not simple. No intersection points are introduced except the selected two.





Note: For multipart (more than one path) polyline output part ordering may not be preserved. The orientation of vertices within parts is preserved.

See Also

IPolyline Interface | IRing.Reshape Method | IPolyline.Reshape Method

.NET Samples

Custom reshape polyline edit task