Sub Main 'Declare the variable that will reference the application Dim SurferApp As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True 'Declares Plot as an object Dim Plot As Object Set Plot = SurferApp.Documents.Add 'Creates a blanked grid SurferApp.GridBlank(SurferApp.Path+"/samples/demogrid.grd",SurferApp.Path+"/samples/demorect.bln",SurferApp.Path+"/samples/demoblanked2.grd") 'Creates a filled image map, and sets the opacity of the missing data fill to 0% (completely transparent) Dim MapFrame1 As Object Set MapFrame1 = Plot.Shapes.AddImageMap(GridFileName:=SurferApp.Path+"\samples\demoblanked2.grd") Dim ImageMap As Object Set ImageMap = MapFrame1.Overlays(1) ImageMap.MissingDataColorRGBA.Opacity=0 'Sets the opacity for the image map layer to be 50% ImageMap.Opacity = 50 'Creates a contour map Dim MapFrame2 As Object Set MapFrame2 = Plot.Shapes.AddContourMap(GridFileName:=SurferApp.Path+"\samples\demogrid.grd") Dim ContourMap As Object Set ContourMap = MapFrame2.Overlays(1) 'Fill contours ContourMap.FillContours = True 'Returns the Levels collection object. Set Levels = ContourMap.Levels 'Set the level fill color with a gradation from blue to red n = Levels.Count ColorInc = 255.0 / (n-1) For i=1 To n ColorInc = 255.0 * (i-1) / (n-1) Levels(i).Fill.ForeColor = RGB(ColorInc,0,255-ColorInc) Next i 'Specifies the opacity for the color fill for all levels in the contour map to 30% n = Levels.Count For i=1 To n Levels(i).Fill.ForeColorRGBA.Opacity = 30 Next i End Sub