AutoShape Object

The AutoShape object is a base object for all graphical objects within the plot document. The properties and methods of this object are shared by all objects derived from the AutoShape object. The AutoShapes collection contains all the shapes in the document. Selected shapes are also contained within the AutoSelection collection.

Properties

Application

Height

Left

Locked

Name

Parent

Rotation

Selected

SizeLocked

Top

Type

Visible

Width

Methods

AddLegend

CopyFormat

Delete

Deselect

PasteFormat

Select

SetZOrder

Example

The following script demonstrates how the AutoShape object is used.

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

 

 'Creates a plot document in Grapher and assigns

 'it to the variable named "Plot"

  Set Plot = GrapherApp.Documents.Add(grfPlotDoc)

 

'Reference the shapes collection

Set Shapes = Plot.Shapes

 

'Create a rectangle shape and assign it to the Rect object

Set Rect = Shapes.AddRectangle( 2, 5, 7, 2)

 

End Sub