AutoPolyline Object


The AutoPolyline object contains the properties of a polyline. Polylines are created with the AutoShapes collection AddPolyline method.


Derived from: AutoShape object (All methods and properties of AutoShape apply to this object.)










The following example shows how to create a polyline.


Sub Main

 'Declares GrapherApp as an object

  Dim GrapherApp As Object


 'Creates an instance of the Grapher Application object

 'and assigns it to the variable named "GrapherApp"

  Set GrapherApp = CreateObject("Grapher.Application")


 'Make Grapher visible

  GrapherApp.Visible = True


 'Declare Docs as Object

  Dim Docs As Object


 'Assigns the Documents collection to

 'the variable named "Docs"

  Set Docs = GrapherApp.Documents


 'Declare Plot As Object

  Dim Plot As Object


 'Creates a new plot window and assigns it

 'to the variable named "Plot"

  Set Plot = Docs.Add(grfPlotDoc)


 'Declare Shapes As Object

  Dim Shapes As Object


 'Assigns the AutoShapes collection to

 'the variable named "Shapes"

  Set Shapes = Plot.Shapes


 'Add Polyline

  Dim Polyline As Object

  Dim LineCoordinates (8) As Double

  LineCoordinates(0) = 4: LineCoordinates(1) = 1

  LineCoordinates(2) = 7: LineCoordinates(3) = 3

  LineCoordinates(4) = 2: LineCoordinates(5) = 6

  LineCoordinates(6) = 1:LineCoordinates(7) = 10

  Set Polyline = Shapes.AddPolyline(LineCoordinates)

End Sub