How can I overlay maps and set new limits and scale via Surfer automation?

To overlay maps and set the new limits and scale, set the OverlayMaps command to a new object, and then set the limits and scale of the new object. A full script showing this process is below.


To run this script:

  1. Copy the script below.
  2. In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer 14\Scripter.
  3. Double click on Scripter.exe to launch Scripter.
  4. Press Ctrl+A to select all of the existing lines then press Delete.
  5. Press Ctrl+V to paste it into Scripter. 
  6. Click Script | Run to run the script.


Sub Main
    Dim SurferApp, Plot, ContourMapFrame, ContourMap, _ 
        ClassedPostMapFrame, ClassedPostMap, BaseMapFrame, BaseMap, _ 
        Shapes As Object 

    Set SurferApp = CreateObject ("Surfer.Application") 
    SurferApp.Visible = True 
    Set Plot = SurferApp.Documents.Add(srfDocPlot) 

    Set MapFrame1 = Plot.Shapes.AddContourMap (SurferApp.Path+"/samples/demogrid.grd") 

    Set MapFrame2 = Plot.Shapes.AddBaseMap (SurferApp.Path+"/samples/demoslice.bln") 

    Set MapFrame3 = Plot.Shapes.AddImageMap(SurferApp.Path+"/samples/demogrid.grd") 

    MapFrame1.Selected = True 
    MapFrame2.Selected = True 
    MapFrame3.Selected = True 

    Set NewMapFrame = Plot.Selection.OverlayMaps


End Sub 


See also the attached script OverlayMaps.bas, which can also be found in the \Samples\Scripts\ folder in the Surfer installation directory.


Updated February 14, 2017

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


Please sign in to leave a comment.