This article contains a sample script for setting the background color in Surfer via automation.
To run this script:
- Copy the script below, or download the attached BAS file: background.bas.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer\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.
*********
'============================================================================ 'BACKGROUND.BAS ' 'This script demonstrates the following: ' Grid a sample data file ' Create a contour map ' Create checkered background color ' ' SKP 9/99 Surfer 7 '============================================================================ Sub Main Dim SurferApp As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True Path=SurferApp.Path+"\Samples\" Dim Doc As Object Set Doc = SurferApp.Documents.Add SurferApp.GridData (DataFile:=path+"demogrid.dat", _ ShowReport:=False, Algorithm:=srfKriging, OutGrid:=path+"sample.grd") Dim MapFrame As Object Set MapFrame = Doc.Shapes.AddContourMap(GridFileName:=Path+"Colorado.grd") 'Changes the map background MapFrame.BackgroundFill.Pattern = "Diagonal Cross" MapFrame.BackgroundFill.BackColorRGBA.Color = srfColorRed MapFrame.BackgroundFill.ForeColorRGBA.Color = srfColorIceBlue End Sub
Updated November 08, 2018
Comments
0 comments
Please sign in to leave a comment.