# Set-OfficeVisioShapeLayout

Applies OfficeIMO Visio selection layout and layer operations to shapes.

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 **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

Aliases: VisioArrange, VisioLayout

**Module**

`PSWriteOffice`

**Aliases**

`VisioArrange` `VisioLayout`

**Inputs**

`System.Object`

**Outputs**

`OfficeIMO.Visio.VisioShape`

**Source**

[SetOfficeVisioShapeLayoutCommand.cs:24](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Visio/SetOfficeVisioShapeLayoutCommand.cs#L24) 

Applies OfficeIMO Visio selection layout and layer operations to shapes.

## Syntax

```
Set-OfficeVisioShapeLayout
[-AlignHorizontal <Left|Center|Right>]
[-AlignVertical <Bottom|Middle|Top>]
[-Columns <Int32>]
[-Distribute <Horizontal|Vertical>]
[-Grid]
[-HorizontalSpacing <Double>]
[-HorizontalStack]
[[-InputObject] <Object>]
[-Layer <String>]
[-NoRouteInternalConnectors]
[-Page <VisioPage>]
[-PassThru]
[-PreserveFirstShapeCenter]
[-ShapeId <String[]>]
[-VerticalSpacing <Double>]
[-VerticalStack]
[<CommonParameters>]
```

[#](#member-9cbec6e4339f69f5e7d53dce)

Parameter set: `All Parameter Sets`

## Examples

### Arrange keyed shapes in a horizontal stack.

```powershell
OfficeVisio -Path .\Layout.vsdx {
    VisioRectangle -Key one -Text 'One'
    VisioRectangle -Key two -Text 'Two'
    VisioLayout -ShapeId one,two -HorizontalStack -HorizontalSpacing 0.4
}
```

Resolves keyed shapes and applies a reusable OfficeIMO Visio layout operation.

## Parameters

**-AlignHorizontal VisioHorizontalAlignment optional**

Horizontal alignment inside the selected shapes' bounds.

Possible values: `Left`, `Center`, `Right`

**-AlignVertical VisioVerticalAlignment optional**

Vertical alignment inside the selected shapes' bounds.

Possible values: `Bottom`, `Middle`, `Top`

**-Columns Int32 optional**

Grid column count. Zero lets OfficeIMO choose a near-square grid.

**-Distribute VisioDistributionAxis optional**

Distribute selected shapes along an axis.

Possible values: `Horizontal`, `Vertical`

**-Grid SwitchParameter optional**

Lay out selected shapes as a grid.

**-HorizontalSpacing Double optional**

Horizontal spacing in inches for grid/stack layout.

**-HorizontalStack SwitchParameter optional**

Lay out selected shapes as a horizontal stack.

**-InputObject Object optionalposition: 0pipeline: True (ByValue)**

Shapes, shape selections, or shape keys/ids to arrange.

**-Layer String optional**

Add selected shapes to this layer.

**-NoRouteInternalConnectors SwitchParameter optional**

Do not reroute internal connectors during OfficeIMO relayout.

**-Page VisioPage optional**

Page that owns the shapes. Optional inside OfficeVisio/VisioPage DSL scopes.

**-PassThru SwitchParameter optional**

Emit arranged shapes.

**-PreserveFirstShapeCenter SwitchParameter optional**

Use the first selected shape as the grid origin instead of preserving the selection top-left.

**-ShapeId String[] optional**

Shape keys or ids to resolve on the target page.

**-VerticalSpacing Double optional**

Vertical spacing in inches for grid/stack layout.

**-VerticalStack SwitchParameter optional**

Lay out selected shapes as a vertical stack.

## 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:D41681B4A5830C73EEC7EC5ECF08EDBB77943CB638D16A44F8945631FAA04EEA -->
