The Area object contains the properties of an area. Areas are created with the AddPolygon or the AddComplexPolygon methods.
Derived from: Shape object (All methods and properties of Shape apply to this object.)
Properties
Methods
Example
The following script shows how to create an area object.
Sub Main
'Declares mvApp as an object
Dim mvApp As Object
'Creates an instance of the MapViewer Application object
'and assigns it to the variable named "mvApp"
Set mvApp = CreateObject("MapViewer.Application")
'Makes MapViewer visible
mvApp.Visible = True
'Declares Plot as an object
Dim Plot As Object
'Creates a map document in MapViewer and assigns
'it to the variable named "Plot"
Set Plot = mvApp.Documents.Add(mvDocPlot)
'Declares PlotLayers as an object
Dim PlotLayers As Object
'Assigns the map document layers to the
'variable named "PlotLayers"
Set PlotLayers = Plot.Layers
'Declares CurrentLayer as an object
Dim CurrentLayer As Object
'Assigns the active plot layer to the
'variable named "CurrentLayer"
Set CurrentLayer = PlotLayers.ActiveLayer
'Declares Shapes as an object
Dim Shapes As Object
'Assigns the Shapes collection to the
'variable named "Shapes"
Set Shapes = CurrentLayer.Shapes
'Declares Area as an object
Dim Area As Object
'Declares PolygonArray as a double array
Dim PolygonArray(5) As Double
PolygonArray(0) = 4: PolygonArray(1) = 1
PolygonArray(2) = 7: PolygonArray(3) = 3
PolygonArray(4) = 2: PolygonArray(5) = 6
'Creates an area and assigns it to the variable named "Area"
Set Area = Shapes.AddPolygon(False, PolygonArray)
End Sub