Rectangle Object

The Rectangle object has been deprecated. The AddRectangle method now returns a Polygon object.

The Rectangle object contains the properties of a rectangle. Rectangles, including rounded rectangles, are created with the AddRectangle method of the Shapes collection.

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

The Following table provides all the properties of the Rectangle object.

>>>>>>> origin/Surfer17

Property

Description

Fill

Returns the fill format object. It is a read-only property.

Line

Returns the line format object. It is a read-only property.

Example

The following script demonstrates how the Rectangle object is used in reference to the Shapes collection.

Sub Main

 

'Declares SurferApp as an object

Dim SurferApp As Object

 

'Creates an instance of the Surfer Application object and assigns it

'to the variable named "SurferApp"

Set SurferApp = CreateObject("Surfer.Application")

 

'Makes Surfer visible

SurferApp.Visible = True

 

'Declares Plot as an object

Dim Plot As Object

 

'Creates a plot document in Surfer and assigns it to the variable

'named "Plot"

Set Plot = SurferApp.Documents.Add(srfDocPlot)

 

'Declares Shapes as an object

Dim Shapes As Object

 

'Assigns the Shapes collection to the variable named "Shapes"

Set Shapes = Plot.Shapes

 

'Declares Rectangle as an object

Dim Rectangle As Object

 

'Creates a rectangle and assigns it to the variable named "Rectangle"

Set Rectangle = Shapes.AddRectangle(5,7,6,10)

 

End Sub