Inserts a copy of the specified Point at the specified point index in the Polyline. If the Polyline has more than one path, the Point is inserted into the first path.

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 pointIndex,
	Point pt
)
Visual Basic (Declaration)
Public Sub InsertPoint ( _
	pointIndex As Integer, _
	pt As Point _
)

Parameters

pointIndex
Type: System..::.Int32

The point index 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 a Polyline with existing points; the inserted point will have the specified pointIndex and all following points in the Polyline 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.

For a multipart Polyline, only the first path is changed; if the PathCount is greater than 1, then the Point is always inserted into the first path in the Polyline; if working with multipart polylines, see the InsertPoint(Int32, Int32, Point) overload in which a path index can be specified to insert the new Point into.

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..::.InvalidOperationExceptionA Point cannot be inserted into an empty Polyline.
System..::.ArgumentOutOfRangeExceptionThe specified pointIndex must not be greater than the number of existing points in the Polyline.

See Also