Sub main 'Creates an instance of the MapViewer Application object 'and assigns it to the variable named "mvApp" Set mvApp = CreateObject("MapViewer.Application") 'Makes the application main window visible mvApp.Visible = True 'Assigns the location of the samples folder to the variable "InPath" InPath$ = mvApp.ApplicationFolder + "samples\" 'Creates a map document object, and assigns it to the variable named "Plot" Set Plot = mvApp.Documents.Add(DocType:=mvDocPlot) 'Creates a hatch map object and assigns it to the variable named "HatchMap" Set HatchMap = Plot.CreateHatchMap(InPath$ + "co2000.gsb", InPath$ + "co2000.dat", "", "", 1, 5, 4) '''''''''''''''''''' 'Loads a color spectrum for the background color HatchMap.BgColorSpectrum.LoadFromList("Forest") 'Set the diameter of the square HatchMap.CircleOrSquareWidth=0.5 'Changes the fill properties for class 1 in the hatch map HatchMap.ClassFill(iClass:=1).ForeColor = mvColorBlue HatchMap.ClassFill(iClass:=1).BackColor = mvColorYellow HatchMap.ClassFill(iClass:=1).Pattern = "Diagonal Cross" HatchMap.ClassFill(iClass:=1).Transparent = False 'Sets the data classification method to Equal Number. HatchMap.ClassificationMethod=mvClassificationEqualNumber 'Returns the index number of the All Others class Debug.Print HatchMap.ClassIndexOfAllOthers 'Returns the index number of the No Data class Debug.Print HatchMap.ClassIndexOfNoData 'Returns the maximum value of class 1 Debug.Print HatchMap.ClassMaxVal(iClass:=2) 'Returns the minimum value of class 1 Debug.Print HatchMap.ClassMinVal(iClass:=1) 'Sets the draw type of the hatch map to be a square HatchMap.DrawType = mvHatchDrawSquare 'Loads a color spectrum for the foreground color HatchMap.FgColorSpectrum.LoadFromList("Flame") 'Set the Pattern and Mode for all classes HatchMap.FillPatAndMode.Pattern = "Gravel" HatchMap.FillPatAndMode.Transparent = True 'Set the data limits to use Global Data HatchMap.GlobalData = True 'Returns the PID column of the worksheet. Debug.Print HatchMap.PIDCol 'Sets the PID column of the worksheet to Column B. 'HatchMap.PIDCol = 2 'Returns the state of the User Limits checkbox Debug.Print HatchMap.UserLimits 'Returns the User Limits max value Debug.Print HatchMap.UserLimitMaxVal 'Returns the User Limits min value Debug.Print HatchMap.UserLimitMinVal 'Sets the variable coloumn of the worksheet to Column H HatchMap.VarCol= 8 'Interpolate all class fills between first and last color HatchMap.InterpolateHatchFills 'Adds a class color to the color spectrum and then interpolate all class fills HatchMap.ClassFill(iClass:=2).ForeColor = mvColorBlue HatchMap.InterpolateWithClassFill(2) 'Set the min and max values for class 1 HatchMap.SetClassMinMaxVals(1,400,4000) 'Set the User Limits state and specify the Min/Max values HatchMap.SetUserLimits(True,500,400000) 'Creates a legend for the map Set Legend = HatchMap.CreateLegend(-2,6) 'Adds HatchMap information in Layer #1 to legend HatchMap.AddLayerToLegend("Layer #1") End Sub