SetVertices [Polygon]

SetVertices sets the polygon vertices.

Syntax

object.SetVertices( Vertices, PolyCounts )

Parameter

Type

Required/

Optional

Default

Description

Vertices

Array of Doubles

Required

This provides the array containing each vertex in the complex polygon.

PolyCounts

Array of Longs

Required

This provides the number of vertices in each sub polygon.

Remarks

The number of vertices in Vertices should equal the sum of all the counts in the PolyCounts array.

Example

This example demonstrates how to define new polygon vertices using an array of doubles named Coordinates and an array of longs named NumPolygons. The even numbered elements within the Coordinates array represent x values, while the odd numbered elements represent their corresponding y values. The elements within the

Dim Coordinates(23) As Double

Coordinates(0)=3.44: Coordinates(1)=4.06

Coordinates(2)=1.10: Coordinates(3)=6.39

Coordinates(4)=3.44: Coordinates(5)=8.73

Coordinates(6)=5.75: Coordinates(7)=6.39

Coordinates(8)=3.36: Coordinates(9)=8.07

Coordinates(10)=5.01: Coordinates(11)=6.42

Coordinates(12)=3.36: Coordinates(13)=4.75

Coordinates(14)=1.71: Coordinates(15)=6.39

Coordinates(16)=1.71: Coordinates(17)=8.07

Coordinates(18)=5.01: Coordinates(19)=8.07

Coordinates(20)=5.01: Coordinates(21)=4.75

Coordinates(22)=1.71: Coordinates(23)=4.75

Dim NumPolygons(2) As Long

NumPolygons(0)=4

NumPolygons(1)=4

NumPolygons(2)=4

Polygon.SetVertices(Vertices:=Coordinates, PolyCounts:=NumPolygons)

Used by: Polygon object

See Also

Info Page