AddPolyLine

The AddPolyLine method adds a new curve or spline curve. Returns a Curve object.

 

Syntax

object.AddPolyLine( bSpline, Vertices, UnitType )

 

Parameter

Type

Description

bSpline

Boolean

required; true to create spline curve

Vertices

Array of Doubles

required; array containing each vertex in the curve

UnitType

MVCoordDisplayUnits

optional; unit type, default is mvCoordDisplayUnitPageUnits

 

Remarks

Use page units in the array. Vertices is an array containing alternating XY page coordinates. This assumes the entire array is used. VB users can use ReDim to set the array size to the used size if necessary or use AddPolyLine2. See Coordinate Arrays for more information about creating arrays in MapViewer.

 

Example

This example demonstrates how to create a polyline using an array of doubles named LineCoordinates. The even numbered elements within the LineCoordinates array represent X values, while the odd numbered elements represent their corresponding Y values.

 

Dim Polyline As Object

 

Dim LineCoordinates (5) As Double

LineCoordinates(0) = 4: LineCoordinates(1) = 1

LineCoordinates(2) = 7: LineCoordinates(3) = 3

LineCoordinates(4) = 2: LineCoordinates(5) = 6

 

Set Polyline = Map Shapes.AddPolyline(bSpline:=True, Vertices:=LineCoordinates)

 

Used by: Shapes collection