AddPolyLine2

The AddPolyLine2 method adds a new curve or spline curve. Returns a Curve object. This method is the same as the AddPolyLine method, except it takes the pointer to the array. VB users may want to call this method instead of AddPolyLine. Note: Golden Software does not officially support VB.

 

Syntax

object.AddPolyLine2( 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. 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 = MapShapes.AddPolyLine2(bSpline:=True, Vertices:=LineCoordinates)

 

Used by: Shapes collection