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 base map and how to fill a selected item in the base map.
To run this script:
- Copy the script below, or click here to download the BAS file: Fill_Selected.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.
*********
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Fill_Selected.BAS
' Copyright (C) Golden Software Inc. 1992-2018
'
' This sample demonstrates how to change select a polygon by PID and then
' assign a specific fill pattern to that polygon
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Main
Set MapViewerApp = CreateObject("MapViewer.Application")
MapViewerApp.Visible = True
Set doc = MapViewerApp.Documents.Add(DocType:=mvDocPlot)
Doc.CreateBaseMap(MapViewerApp.ApplicationFolder+"samples\co2010.gsb")
Doc.Layers(1).Shapes.SelectByPID("08059")
Dim area As Object
Set area = Doc.Layers(1).Shapes.Item("08059")
area.Fill.Pattern = "Crosshatch"
area.Fill.ForeColor = mvColorGreen
End Sub
Updated May 22, 2018
Comments
0 comments
Please sign in to leave a comment.