AddRectangle

AddRectangle adds a new rectangle or rounded rectangle shape. Returns a Polygon object.

Syntax

object.AddRectangle( Left, Bottom, Right, Top, xRadius, yRadius )

Parameter

Type

Default

Description

Left

Double

 

required; This provides the left coordinate

Bottom

Double

 

required; This provides the bottom coordinate

Right

Double

 

required; This provides the right coordinate

Top

Double

 

required; This provides the top coordinate

xRadius

Double

0.0

optional; This provides the X radius for rounded rectangle corner

yRadius

Double

0.0

optional; This provides the Y radius for rounded rectangle corner

Remarks

Either page units or map coordinates are used for the Left, Right, Bottom, and Top parameters. When the rectangle is added to the plot, use page units for the parameter coordinates. When the rectangle is added to a map layer, use map coordinates to specify the parameters coordinates.

If only xRadius or yRadius are used, a square-cornered rectangle results. Use both xRadius and yRadius to round the corners.

Example 1

This example demonstrates how to create a rectangle.

'declare Rectangle object and create a new rectangle

Dim Rectangle As Object

Set Rectangle = Shapes.AddRectangle(Left:=5, Bottom:=7, Right:=6, Top:=10)

Example 2

This script displays all the methods and properties in the Shapes collection.

Used by: Shapes collection