The AutoSelection collection contains all the properties and methods associated with the collection of selected shapes. The AutoSelection collection defines methods that operate on one or more selected shapes. Most commands within Grapher that require selected objects are part of the AutoSelection collection.
This example shows how use the AutoSelection collection.
'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")
'Makes Grapher visible
GrapherApp.Visible = True
'Declares Plot as an object
Dim Plot As Object
'Creates a plot document in Grapher and assigns
'it to the variable named "Plot"
Set Plot = GrapherApp.Documents.Add(grfPlotDoc)
'Declares Shapes as an object
Dim Shapes As Object
'Assigns the AutoShapes collection to
'the variable named "Shapes"
Set Shapes = Plot.Shapes
'Declares Ellipse as an object
Dim Ellipse As Object
'Creates an ellipse and assigns it to the
'variable named "Ellipse"
Set Ellipse = Shapes.AddEllipse(5,7,6,10)
'Declares Text1 as an Object
Dim Text1 As Object
'Creates a text object and assigns it to
'the variable named "Text1"
Set Text1 = Shapes.AddText( 2,5,"This is text")
'Declares Selection as an Object
Dim Selection As Object
'Selects both objects
'Sets the AutoSelection collection to the
'variable named "Selection"
Set Selection = Plot.Selection