How can I save a grid report when using Surfer Scripter?

This article contains a sample script for gridding a sample data file, creating a Grid Report, and saving the grid report.

To run this script:

  1. Copy the script below, or download the attached BAS file: SaveGridReport.BAS.
  2. In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer 16.
  3. Double click on Scripter.exe to launch Scripter.
  4. Press Ctrl+A to select all of the existing lines then press Delete.
  5. 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.
  6. Change the values in the User-defined variables section as desired.
  7. Click Script | Run to run the script.

'This script demonstrates:
'	Grid a sample data file
'	Create a Grid Report
'	Save the grid report
Sub Main

'Initializes Surfer
	Dim Surf, Plot As Object
	Set Surf = CreateObject("Surfer.Application")
	Surf.Visible = True
	Set Plot = Surf.Documents.Add

'User-defined variables
	path1 = Surf.Path + "\samples\"
	infile= path1+"demogrid.dat"

'Grid the data and include the Grid Report
	Surf.GridData(infile,ShowReport:=True, OutGrid:=path1+"test.grd")

'Save the grid report
	AppActivate "Surfer - GridDataReport"
	Wait 1
	SendKeys "{Menu}+F+S
	Wait 1
	SendKeys "test.rtf + {Enter}"
	Wait 1
	SendKeys "{Menu}+F+C"

'Exit Surfer

End Sub


Updated November 6, 2018

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.