SetVertices

 

The SetVertices method sets the area (polygon) vertices.

 

Syntax

object.SetVertices( Vertices, PolyCounts, UnitType )

 

Parameter

Type

Description

Vertices

Array of Doubles

required, array containing each vertex in the complex area

PolyCounts

Array of Longs

required, number of vertices in each sub area

UnitType

MVCoordDisplayUnits

optional; unit type, default is mvCoordDisplayUnitPageUnits

 

Remarks

The number of vertices in Vertices should equal the sum of all the counts in the PolyCounts array. VB users can use ReDim to set the array size to the used size if necessary or you can use SetVertices2. See Coordinate Arrays for more information about creating arrays in MapViewer.

 

Example

This example demonstrates how to define new area (comprised of three sub areas) 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 NumPolygons array represent the simple polygons defined within the complex polygon; their values indicating the number of coordinate pairs needed to create them.

 

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

 

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

 

Used by: Area object