Surfer's range ring and buffer features can be used to create shapes with a defined radius. The RangeRing help page provides a sample script for use of this feature via automation. Alternatively, the script below creates a circle centered around the XY coordinates defined in a data file.
To run this script:
- Copy the script below.
- 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.
- Press Ctrl+V to paste it into Scripter.
- Change the Buffer value to the desired radius on line 21.
- Click Script | Run to run the script.
Sub Main Dim SurferApp, Plot, Shapes, Location, Wks, Ellipse As Object Set SurferApp = CreateObject("Surfer.Application") SurferApp.Visible = True Set Plot = SurferApp.Documents.Add(srfDocPlot) Set Shapes = Plot.Shapes 'Specify location of point Set Location = Shapes.AddSymbol(x:=4, y:=3) 'Select which point you want to draw the circle around, export to BLN and view the coordinates of the point Location.Select Plot.Export("c:\temp\testpoint.bln", True) Set Wks = SurferApp.Documents.Open(FileName:="c:\temp\testpoint.bln") Xcoord = Wks.Cells(Row:=2, Col:=1) Ycoord = Wks.Cells(Row:=2, Col:=2) 'Add or subtract your buffer value from the point coordinates to create the circle Buffer=5 Set Ellipse = Shapes.AddEllipse(Left:=Xcoord-Buffer, Top:=Ycoord+Buffer, Right:=Xcoord+Buffer, Bottom:=Ycoord-Buffer) Wks.Close End Sub
Updated November 2021
Comments
Please sign in to leave a comment.