Inserts a copy of the specified Point at the specified point index in the specified path of the Polyline.

Namespace:  ESRI.ArcGISExplorer.Geometry

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public void InsertPoint(
	int pathIndex,
	int pointIndex,
	Point pt
)
Visual Basic (Declaration)
Public Sub InsertPoint ( _
	pathIndex As Integer, _
	pointIndex As Integer, _
	pt As Point _
)

Parameters

pathIndex
Type: System..::.Int32

The index of the path to copy the new Point into.
pointIndex
Type: System..::.Int32

The point index within the specified pathIndex to copy the new Point into.
pt
Type: ESRI.ArcGISExplorer.Geometry..::.Point

The Point to copy into the Polyline.

Remarks

Use this method to insert a new Point into an existing path of a multipart Polyline; the inserted point will have the specified pointIndex and all following points in the path will increase their index position by 1. If the pointIndex is equal to the number of points, this method behaves like the AddPoint method, copying the Point after all existing points in the specified path. The specified pathIndex must already exist in the Polyline.

If working with single part polylines, the InsertPoint(Int32, Point) overload is also available.

Note that the CoordinateSystem property of any new points added, inserted or set into existing an existing Polygon or Polyline will be discarded, and the coordinates (X and Y properties) of the point assumed to be in the same CoordinateSystem as the Polygon or Polyline to which they are added.

Exceptions

ExceptionCondition
System..::.ArgumentOutOfRangeExceptionThe specified pointIndex must not be greater than the number of existing points in the specified path, and the specified pathIndex must already exist in the Polyline.
System..::.InvalidOperationExceptionA Point cannot be inserted into an empty Polyline.

See Also