How can I open my SRF file and edit the map in Surfer Scripter?

This article contains a sample script for opening an SRF file and selecting a map for editing.

To run this script:

  1. Copy the script below, or download the attached file: Open SRF Select Map.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. Click Script | Run to run the script.


'Open SRF Select Map.bas demonstrates how to open an SRF file and select a map for editing.


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 and opens an SRF file
    Dim Plot As Object
	Set Plot = SurferApp.Documents.Open(FileName:=SurferApp.Path+"\Samples\Surface.srf")

'Assigns the desired map in the SRF file to the variable "MapFrame1"
'You may need to change the Index number so that the map in the SRF file is selected.
'Count from the bottom in the Contents Window up to the map you want to get the correct Index number of the map.
	Dim MapFrame1 As Object
	Set MapFrame1 = Plot.Shapes.Item(Index:=1)

'Changes the tilt for the map
	MapFrame1.ViewTilt = 16
	MapFrame1.ViewRotation = 90

End Sub


Updated November 12, 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.