KB no longer maintained - MapViewer is a Legacy Product. Legacy Products are still supported, but no longer receive new features or updates. Many of MapViewer's features have been moved to Surfer. Please contact support@goldensoftware.com with any questions. |
This article contains a sample script for creating a map and combining areas into a new “union” of the combined areas.
To run this script:
- Copy the script below, or click here to download the BAS file: Union of Areas.BAS.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\MapViewer 8\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
*********
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Union_of_Areas.BAS ' Copyright (C) Golden Software Inc. 1992-2015 ' ' This sample demonstrates how to select two areas and use the Union Of Areas command to combine them ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main Set mvApp = CreateObject("MapViewer.Application") mvApp.Visible = True Dim Plot, area As Object Set Plot = mvApp.Documents.Add(DocType:=mvDocPlot) InPath$ = mvApp.ApplicationFolder + "samples\" 'Creates a base map Plot.CreateBaseMap("CA2010.gsb") 'Selects two areas (by PID) from the base map layer Plot.Layers(1).Shapes.SelectByPID("06093") Plot.Layers(1).Shapes.SelectByPID("06049") 'Uses the Union Of Areas command to combine the areas Plot.Layers(1).Selection.UnionOfAreas(KeepOriginalAreas:=False, KeepInnerareas:=True) 'Renames the new area, 'area' Set area = Plot.Layers(1).Selection.Item(1) 'Fills the area with a green crosshatch fill pattern area.Fill.Pattern = "Crosshatch" area.Fill.ForeColor = mvColorGreen 'Gives the area a PID of 'Zone 1' area.PIDName="Zone 1" End Sub
Updated November 2, 2016
Comments
0 comments
Please sign in to leave a comment.