# Add-OfficeVisioRectangle

Adds a rectangle shape to the current Visio page. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: VisioRect, VisioRectangle

**Module**

`PSWriteOffice`

**Aliases**

`VisioRect` `VisioRectangle`

**Inputs**

`OfficeIMO.Visio.VisioPage`

**Outputs**

`OfficeIMO.Visio.VisioShape`

**Source**

[AddOfficeVisioRectangleCommand.cs:19](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Visio/AddOfficeVisioRectangleCommand.cs#L19) 

Adds a rectangle shape to the current Visio page.

## Syntax

```
Add-OfficeVisioRectangle
[-Angle <Double>]
[-FillColor <String>]
[-FillPattern <Int32>]
[-Height <Double>]
[-Key <String>]
[-LineColor <String>]
[-LinePattern <Int32>]
[-LineWeight <Double>]
[-Name <String>]
[-NameU <String>]
[-Page <VisioPage>]
[-PassThru]
[[-Text] <String>]
[-Unit <Inches|Centimeters|Millimeters>]
[-Width <Double>]
[-X <Double>]
[-Y <Double>]
[<CommonParameters>]
```

[#](#method-add-officevisiorectangle-double-string-int32-double-string-string-int32-double-string-string-visiopage-switchparameter-string-visiomeasurementunit-double-double-double)

Parameter set: `All Parameter Sets`

## Examples

### Add a labeled process box.

```powershell
OfficeVisio -Path .\Flow.vsdx {
    VisioRectangle -Key intake -Text 'Intake' -X 1.5 -Y 4 -Width 1.7 -Height 0.8 -FillColor '#E0F2FE'
}
```

Adds a rectangle and registers a key for later connector commands.

## Parameters

**-Angle Double optional**

Shape angle in radians.

**-FillColor String optional**

Fill color name or hex value.

**-FillPattern Int32 optional**

Native Visio fill-pattern index: 0 has no fill, 1 is solid, and 2 through 40 select built-in patterns.

**-Height Double optional**

Shape height.

**-Key String optional**

DSL key used by connector commands.

**-LineColor String optional**

Line color name or hex value.

**-LinePattern Int32 optional**

Native Visio line-pattern index: 0 hides the line, 1 is solid, and 2 through 23 select built-in patterns.

**-LineWeight Double optional**

Line weight.

**-Name String optional**

Optional shape name.

**-NameU String optional**

Optional universal shape name.

**-Page VisioPage optionalpipeline: True (ByValue)**

Target page. Optional inside VisioPage or OfficeVisio.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-Text String optionalposition: 0**

Text placed inside the shape.

**-Unit VisioMeasurementUnit optional**

Measurement unit for coordinates and dimensions.

Possible values: `Inches`, `Centimeters`, `Millimeters`

**-Width Double optional**

Shape width.

**-X Double optional**

X coordinate of the shape origin.

**-Y Double optional**

Y coordinate of the shape origin.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:1A1128AF87C9E7D34E53897A3D72AA295B760B4DC10AED97AD80CAEC1C37CD38 -->
