How can I use Scripter to draw an ellipse from a centerpoint and radii in Grapher?

Below is a sample script for creating an ellipse from a centerpoint and radii in Grapher. To run this script:

  1. Copy the script.
  2. In a Windows Explorer window, navigate to C:\Program Files\Golden Software\Grapher 12\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. If you copied this script, press Ctrl+V to paste it into Scripter. 
  6. Click Script | Run to run the script.


 Sub Main

 'Initializes Grapher
  Dim GrapherApp, Docs, Plot, Shapes As Object
  Set GrapherApp =  CreateObject("Grapher.Application")
  GrapherApp.Visible = True
  Set Docs =  GrapherApp.Documents
  Set Plot =  Docs.Add(grfPlotDoc)
  Set Shapes = Plot.Shapes

'----------------------- 'User-defined variables
'Vertical radius RadV = 0.5
'Horizontal radius RadH = 1
'Horizontal (x) coordinate of the center point CenterH = 3
'Vertical (y) coordinate of the center point CenterV = 7
'--------------------- 'Calculate the left, top, right, and bottom of the ellipse L = CenterH - RadH R = CenterH + RadH B = CenterV - RadV T = CenterV + RadV 'Add Ellipse Set Ellipse1=Shapes.AddEllipse( L, T, R, B, "Ellipse1" ) End Sub


Updated March 23, 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.