Follow

How can I draw a circle around a point at a defined radius via Surfer Scripter?

You can draw a circle at a particular radius from a drawn point via a script like the one below. You may be able to modify it for a point in a post map.
 

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, 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-1, Top:=Ycoord+1, Right:=Xcoord+1, Bottom:=Ycoord-1)

    Wks.Close

End Sub

 

Updated February 14, 2017

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

0 Comments

Please sign in to leave a comment.