AddPolygon Method

The AddPolygon method creates a polygon. Returns an AutoPolygon object.

Syntax

object.AddPolygon( vertices, id )

 

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

 

Remarks

Use page units in the array. The vertices parameter 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 polygon and create a new polygon. The even numbered elements within the Coordinates array represent X values, while the odd numbered elements represent their corresponding Y values.

Dim Polygon 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 Polygon = Shapes.AddPolygon(Coordinates)

 

Used by: AutoShapes collection