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:
- Copy the script below, or download the attached BAS file: OverlayMaps.bas.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Surfer 16.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- Press Ctrl+V to paste it into Scripter.
- 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 NewMapFrame.SetLimits(4,7,3,6) NewMapFrame.xMapPerPU=0.5 NewMapFrame.yMapPerPU=0.5 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 November 1, 2018
2 Comments