' Create_Hatch_Map_and_Sort.bas ' ' This script creates a hatch map and then sorts the objects ' by their linked data values. ' ' This script requires MapViewer 6 or later. It will not run work ' with MapViewer 5. ' ' Mike Blessing, Golden Software, 27-Jul-2004 ' mapviewersupport@goldensoftware.com ' Option Explicit Sub Main Dim mvApp, plot, hatch As Object Dim path As String ' Start MapViewer and create a pointer to the application object Set mvApp = CreateObject("MapViewer.Application") ' Make the application visible mvApp.Visible = True ' Create a plot document Set plot = mvApp.Documents.Add(DocType:=mvDocPlot) ' Set the path variable to point to the MapViewer samples folder path = mvApp.ApplicationFolder + "samples\" ' Create a hatch map of the population in Alabama ' Col A contains the PID ' Col C contains the population Set hatch = plot.CreateHatchMap( _ BoundaryFileName := path + "al2000.gsb", _ DataFileName := path + "al2000.dat", _ PIDCol := 1, _ VarCol := 3 ) ' Sort by population plot.ActiveLayer.SortObjects( _ Type := mvSortByLinkedData, _ Ascending := True, _ IgnoreCase := True, _ DataCol := 3, _ LabelInFirstRow := True _ ) End Sub