Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeVisioShapeLayout

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

Applies OfficeIMO Visio selection layout and layer operations to shapes.

Syntax

Set-OfficeVisioShapeLayout
[-Distribute <Horizontal|Vertical>]
[-HorizontalAlignment <Left|Center|Right>]
[[-InputObject] <Object>]
[-Layer <String>]
[-Page <VisioPage>]
[-PassThru]
[-ShapeId <String[]>]
[-VerticalAlignment <Bottom|Middle|Top>]
[<CommonParameters>]
#
Parameter set: Alignment
Set-OfficeVisioShapeLayout
[-Columns <Int32>]
-Grid
[-HorizontalSpacing <OfficeLength>]
[[-InputObject] <Object>]
[-Layer <String>]
[-NoRouteInternalConnectors]
[-Page <VisioPage>]
[-PassThru]
[-PreserveFirstShapeCenter]
[-ShapeId <String[]>]
[-VerticalSpacing <OfficeLength>]
[<CommonParameters>]
#
Parameter set: Grid
Set-OfficeVisioShapeLayout
[-HorizontalSpacing <OfficeLength>]
-HorizontalStack
[[-InputObject] <Object>]
[-Layer <String>]
[-NoRouteInternalConnectors]
[-Page <VisioPage>]
[-PassThru]
[-ShapeId <String[]>]
[<CommonParameters>]
#
Parameter set: HorizontalStack
Set-OfficeVisioShapeLayout
[[-InputObject] <Object>]
[-Layer <String>]
[-NoRouteInternalConnectors]
[-Page <VisioPage>]
[-PassThru]
[-ShapeId <String[]>]
[-VerticalSpacing <OfficeLength>]
-VerticalStack
[<CommonParameters>]
#
Parameter set: VerticalStack

Examples

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.4in
}

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

Parameters

-Distribute VisioDistributionAxis optionalsets: Alignment
Distribute selected shapes along an axis.
Possible values: Horizontal, Vertical
-HorizontalAlignment VisioHorizontalAlignment optionalsets: Alignment
Horizontal alignment inside the selected shapes' bounds.
Possible values: Left, Center, Right
-InputObject Object optionalposition: 0pipeline: True (ByValue)
Shapes, shape selections, or shape keys/ids to arrange.
-Layer String optional
Add selected shapes to this layer.
-Page VisioPage optional
Page that owns the shapes. Optional inside OfficeVisio/VisioPage DSL scopes.
-PassThru SwitchParameter optional
Emit arranged shapes.
-ShapeId String[] optional
Shape keys or ids to resolve on the target page.
-VerticalAlignment VisioVerticalAlignment optionalsets: Alignment
Vertical alignment inside the selected shapes' bounds.
Possible values: Bottom, Middle, Top
-Columns Int32 optionalsets: Grid
Grid column count. Zero lets OfficeIMO choose a near-square grid.
-Grid SwitchParameter requiredsets: Grid
Lay out selected shapes as a grid.
-HorizontalSpacing OfficeLength optionalsets: Grid, HorizontalStack
Horizontal spacing; a number means points for grid/stack layout.
-NoRouteInternalConnectors SwitchParameter optionalsets: Grid, HorizontalStack, VerticalStack
Do not reroute internal connectors during OfficeIMO relayout.
-PreserveFirstShapeCenter SwitchParameter optionalsets: Grid
Use the first selected shape as the grid origin instead of preserving the selection top-left.
-VerticalSpacing OfficeLength optionalsets: Grid, VerticalStack
Vertical spacing; a number means points for grid/stack layout.
-HorizontalStack SwitchParameter requiredsets: HorizontalStack
Lay out selected shapes as a horizontal stack.
-VerticalStack SwitchParameter requiredsets: VerticalStack
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.