AddPolyline Method

The AddPolyline method creates a polyline. Returns an AutoPolyline object.

Syntax

object.AddPolyline( vertices, id )

 

Parameter Type Description
vertices Variant optional, see the Remarks below
id Variant optional, polyline name

 

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 Grapher.

Example

This example shows how to dimension the coordinates for a polyline and create a new polyline. The even numbered elements within the coordinates array represent X values, while the odd numbered elements represent their corresponding Y values.

Dim Polyline As Object

Dim Coordinates(5) As Double

Coordinates(0) = 4: Coordinates(1) = 1

Coordinates(2) = 7: Coordinates(3) = 3

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

Set Polyline = Shapes.AddPolyline(Coordinates)

 

Used by: AutoShapes collection