AutoSelection Collection

 

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.

 

Properties

Application

Count

Height

Left

Parent

Top

Width

 

Methods

Align2

Combine

Copy

CopyFormat

Cut

Delete

DeselectAll

Distribute2

Duplicate

Item

Move

Resize

Rotate

SetZOrder

 

Example

This example shows how use the AutoSelection collection.

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")

 

 '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

  Shapes.SelectAll

 

 'Sets the AutoSelection collection to the

 'variable named "Selection"

  Set Selection = Plot.Selection

End Sub