Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeVisioShapeLayout

Aliases: VisioArrange, VisioLayout
Module PSWriteOffice
Aliases
VisioArrange VisioLayout
Inputs
System.Object
Outputs
OfficeIMO.Visio.VisioShape

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>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

Arrange keyed shapes in a horizontal stack.

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.