API Reference
VisioShapeSelection
Editable set of Visio shapes returned by query helpers.
Inheritance
- Object
- VisioShapeSelection
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method VisioDuplicationExtensions.Duplicate
- Method VisioDuplicationExtensions.DuplicateShapes
- Method VisioLayoutExtensions.Align
- Method VisioLayoutExtensions.Distribute
- Method VisioLayoutExtensions.DistributeHorizontally
- Method VisioLayoutExtensions.DistributeVertically
- Method VisioLayoutExtensions.RelayoutAsGrid
- Method VisioLayoutExtensions.RelayoutAsGrid
- Method VisioLayoutExtensions.RelayoutAsHorizontalStack
- Method VisioLayoutExtensions.RelayoutAsVerticalStack
- Method VisioLayoutExtensions.ResizeToText
- Method VisioMasterEditingExtensions.ReplaceMaster
- Extension method VisioPage.DuplicateShapes
- Extension method VisioPage.SelectByMaster
- Extension method VisioPage.SelectByName
- Extension method VisioPage.SelectByNameU
- Extension method VisioPage.SelectCallouts
- Extension method VisioPage.SelectContainers
- Extension method VisioPage.SelectContainingText
- Extension method VisioPage.SelectLayer
- Extension method VisioPage.SelectShapes
- Extension method VisioPage.SelectWithData
- Extension method VisioPage.SelectWithData
- Extension method VisioPage.SelectWithHyperlink
- Extension method VisioPage.SelectWithHyperlinks
- Extension method VisioPage.SelectWithProtection
- Extension method VisioPage.SelectWithProtection
- Extension method VisioPage.SelectWithShapeData
- Extension method VisioPage.SelectWithShapeData
- Extension method VisioPage.SelectWithUserCell
- Extension method VisioPage.SelectWithUserCell
- Method VisioPageQueryExtensions.SelectByMaster
- Method VisioPageQueryExtensions.SelectByName
- Method VisioPageQueryExtensions.SelectByNameU
- Method VisioPageQueryExtensions.SelectCallouts
- Method VisioPageQueryExtensions.SelectContainers
- Method VisioPageQueryExtensions.SelectContainingText
- Method VisioPageQueryExtensions.SelectLayer
- Method VisioPageQueryExtensions.SelectShapes
- Method VisioPageQueryExtensions.SelectWithData
- Method VisioPageQueryExtensions.SelectWithData
- Method VisioPageQueryExtensions.SelectWithHyperlink
- Method VisioPageQueryExtensions.SelectWithHyperlinks
- Method VisioPageQueryExtensions.SelectWithProtection
- Method VisioPageQueryExtensions.SelectWithProtection
- Method VisioPageQueryExtensions.SelectWithShapeData
- Method VisioPageQueryExtensions.SelectWithShapeData
- Method VisioPageQueryExtensions.SelectWithUserCell
- Method VisioPageQueryExtensions.SelectWithUserCell
- Extension method VisioShapeSelection.Align
- Extension method VisioShapeSelection.Align
- Extension method VisioShapeSelection.ApplyStyle
- Extension method VisioShapeSelection.ApplyTextStyle
- Extension method VisioShapeSelection.Distribute
- Extension method VisioShapeSelection.DistributeHorizontally
- Extension method VisioShapeSelection.DistributeVertically
- Extension method VisioShapeSelection.Duplicate
- Extension method VisioShapeSelection.RelayoutAsGrid
- Extension method VisioShapeSelection.RelayoutAsGrid
- Extension method VisioShapeSelection.RelayoutAsHorizontalStack
- Extension method VisioShapeSelection.RelayoutAsVerticalStack
- Extension method VisioShapeSelection.ReplaceMaster
- Extension method VisioShapeSelection.ReplaceMaster
- Extension method VisioShapeSelection.ReplaceMaster
- Extension method VisioShapeSelection.ResizeToText
- Method VisioShapeSelection.ClearProtection
- Method VisioShapeSelection.Data
- Method VisioShapeSelection.Fill
- Method VisioShapeSelection.Hyperlink
- Method VisioShapeSelection.Layer
- Method VisioShapeSelection.LineColor
- Method VisioShapeSelection.LinePattern
- Method VisioShapeSelection.LineWeight
- Method VisioShapeSelection.LockPosition
- Method VisioShapeSelection.LockSize
- Method VisioShapeSelection.MoveBy
- Method VisioShapeSelection.Protect
- Method VisioShapeSelection.ShapeData
- Method VisioShapeSelection.Size
- Method VisioShapeSelection.Stroke
- Method VisioShapeSelection.Style
- Method VisioShapeSelection.Text
- Method VisioShapeSelection.UserCell
Accepted by parameters
- Method VisioDuplicationExtensions.Duplicate
- Method VisioLayoutExtensions.Align
- Method VisioLayoutExtensions.Align
- Method VisioLayoutExtensions.Distribute
- Method VisioLayoutExtensions.DistributeHorizontally
- Method VisioLayoutExtensions.DistributeVertically
- Method VisioLayoutExtensions.GetShapeBounds
- Method VisioLayoutExtensions.RelayoutAsGrid
- Method VisioLayoutExtensions.RelayoutAsGrid
- Method VisioLayoutExtensions.RelayoutAsHorizontalStack
- Method VisioLayoutExtensions.RelayoutAsVerticalStack
- Method VisioLayoutExtensions.ResizeToText
- Method VisioMasterEditingExtensions.ReplaceMaster
- Method VisioMasterEditingExtensions.ReplaceMaster
- Method VisioMasterEditingExtensions.ReplaceMaster
- Extension method VisioShapeSelection.Align
- Extension method VisioShapeSelection.Align
- Extension method VisioShapeSelection.Distribute
- Extension method VisioShapeSelection.DistributeHorizontally
- Extension method VisioShapeSelection.DistributeVertically
- Extension method VisioShapeSelection.Duplicate
- Extension method VisioShapeSelection.RelayoutAsGrid
- Extension method VisioShapeSelection.RelayoutAsGrid
- Extension method VisioShapeSelection.RelayoutAsHorizontalStack
- Extension method VisioShapeSelection.RelayoutAsVerticalStack
- Extension method VisioShapeSelection.ReplaceMaster
- Extension method VisioShapeSelection.ReplaceMaster
- Extension method VisioShapeSelection.ReplaceMaster
- Method VisioStyleExtensions.ApplyStyle
- Method VisioStyleExtensions.ApplyTextStyle
Constructors
public VisioShapeSelection(IEnumerable<VisioShape> shapes, VisioPage ownerPage = null) #Initializes a new shape selection.
Parameters
- shapes System.Collections.Generic.IEnumerable{OfficeIMO.Visio.VisioShape}
- Shapes included in the selection.
- ownerPage OfficeIMO.Visio.VisioPage = null
- Optional page that owns the selection.
Methods
public VisioShapeSelection ClearProtection() #VisioShapeSelectionClears explicit protection settings for every selected shape.
public VisioShapeSelection Data(String key, String value) #VisioShapeSelectionSets or replaces a data value on every selected shape.
Parameters
- key System.String
- Data key.
- value System.String
- Data value.
public VisioShapeSelection Fill(OfficeColor color, Int32 pattern = 1) #VisioShapeSelectionSets fill color and optional fill pattern on every selected shape.
Parameters
- color OfficeIMO.Drawing.OfficeColor
- Fill color.
- pattern System.Int32 = 1
- Fill pattern index.
public virtual IEnumerator<VisioShape> GetEnumerator() #IEnumerator<VisioShape>public VisioShapeSelection Hyperlink(String address, String description = null, String subAddress = null) #VisioShapeSelectionAdds a hyperlink to every selected shape.
Parameters
- address System.String
- External hyperlink address.
- description System.String = null
- Optional display description.
- subAddress System.String = null
- Optional internal sub-address.
public VisioShapeSelection Layer(String layerName) #VisioShapeSelectionAdds every selected shape to a page layer.
Parameters
- layerName System.String
- Layer name.
public VisioShapeSelection LineColor(OfficeColor color) #VisioShapeSelectionSets line color on every selected shape.
Parameters
- color OfficeIMO.Drawing.OfficeColor
- Line color.
public VisioShapeSelection LinePattern(Int32 pattern) #VisioShapeSelectionSets line pattern on every selected shape.
Parameters
- pattern System.Int32
- Line pattern index.
public VisioShapeSelection LineWeight(Double weight) #VisioShapeSelectionSets line weight on every selected shape.
Parameters
- weight System.Double
- Line weight in inches.
public VisioShapeSelection LockPosition(Boolean locked = true) #VisioShapeSelectionLocks or unlocks position for every selected shape.
Parameters
- locked System.Boolean = true
public VisioShapeSelection LockSize(Boolean locked = true) #VisioShapeSelectionLocks or unlocks size for every selected shape.
Parameters
- locked System.Boolean = true
public VisioShapeSelection MoveBy(Double deltaX, Double deltaY) #VisioShapeSelectionMoves every selected shape by the provided offset.
Parameters
- deltaX System.Double
- Horizontal offset in inches.
- deltaY System.Double
- Vertical offset in inches.
public VisioShapeSelection Protect(Action<VisioShapeProtection> configure) #VisioShapeSelectionConfigures protection for every selected shape.
Parameters
- configure System.Action{OfficeIMO.Visio.VisioShapeProtection}
- Protection configuration delegate.
public VisioShapeSelection ShapeData(String name, String value, String label = null, Nullable<VisioShapeDataType> type = null, String prompt = null, String format = null) #VisioShapeSelectionSets or replaces a Visio Shape Data row on every selected shape.
Parameters
- name System.String
- Shape Data row name.
- value System.String
- Shape Data value.
- label System.String = null
- Optional label shown in Visio's Shape Data window.
- type System.Nullable{OfficeIMO.Visio.VisioShapeDataType} = null
- Optional Shape Data type.
- prompt System.String = null
- Optional help prompt.
- format System.String = null
- Optional format picture or list values.
public VisioShapeSelection Size(Double width, Double height) #VisioShapeSelectionResizes every selected shape.
Parameters
- width System.Double
- New width in inches.
- height System.Double
- New height in inches.
public VisioShapeSelection Stroke(OfficeColor color, Double weight = 0.0138889, Int32 pattern = 1) #VisioShapeSelectionSets stroke color, weight, and pattern on every selected shape.
Parameters
- color OfficeIMO.Drawing.OfficeColor
- Line color.
- weight System.Double = 0.0138889
- Line weight in inches.
- pattern System.Int32 = 1
- Line pattern index.
public VisioShapeSelection Style(VisioShapeStyle style) #VisioShapeSelectionApplies a reusable shape style on every selected shape.
Parameters
- style OfficeIMO.Visio.VisioShapeStyle
- Shape style to apply.
System#Collections#IEnumerable#GetEnumerator() #public VisioShapeSelection Text(Func<VisioShape, String> textFactory) #VisioShapeSelectionSets text on every selected shape.
Parameters
- text System.String
- Text to assign.
Text(System.Func{OfficeIMO.Visio.VisioShape,System.String} textFactory) #Updates text on every selected shape from the current shape.
Parameters
- textFactory System.Func{OfficeIMO.Visio.VisioShape,System.String}
- Factory returning text for each shape.
public VisioShapeSelection UserCell(String name, String value, String unit = null, String formula = null, String prompt = null) #VisioShapeSelectionSets or replaces a Visio User cell on every selected shape.
Parameters
- name System.String
- User cell row name.
- value System.String
- User cell value.
- unit System.String = null
- Optional Visio unit code.
- formula System.String = null
- Optional ShapeSheet formula.
- prompt System.String = null
- Optional prompt value.
Inherited Methods
Properties
Extension Methods
public static VisioShapeSelection Align(VisioShapeSelection selection, VisioHorizontalAlignment alignment) #VisioShapeSelectionAligns selected shapes horizontally inside the current selection bounds.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to align.
- alignment OfficeIMO.Visio.VisioHorizontalAlignment
- Horizontal alignment.
public static VisioShapeSelection Align(VisioShapeSelection selection, VisioVerticalAlignment alignment) #VisioShapeSelectionAligns selected shapes horizontally inside the current selection bounds.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to align.
- alignment OfficeIMO.Visio.VisioHorizontalAlignment
- Horizontal alignment.
public static VisioShapeSelection ApplyStyle(VisioShapeSelection selection, VisioShapeStyle style) #VisioShapeSelectionApplies a reusable style to a shape.
Parameters
- shape OfficeIMO.Visio.VisioShape
- style OfficeIMO.Visio.VisioShapeStyle
public static VisioShapeSelection ApplyTextStyle(VisioShapeSelection selection, VisioTextStyle style) #VisioShapeSelectionApplies a reusable text style to a shape.
Parameters
- shape OfficeIMO.Visio.VisioShape
- style OfficeIMO.Visio.VisioTextStyle
public static VisioShapeSelection Distribute(VisioShapeSelection selection, VisioDistributionAxis axis) #VisioShapeSelectionDistributes selected shapes by center point along the requested axis.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to distribute.
- axis OfficeIMO.Visio.VisioDistributionAxis
- Distribution axis.
public static VisioShapeSelection DistributeHorizontally(VisioShapeSelection selection) #VisioShapeSelectionDistributes selected shapes horizontally by center point.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to distribute.
public static VisioShapeSelection DistributeVertically(VisioShapeSelection selection) #VisioShapeSelectionDistributes selected shapes vertically by center point.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to distribute.
public static VisioShapeSelection Duplicate(VisioShapeSelection selection, Double offsetX = 0.35, Double offsetY = -0.35, Boolean includeInternalConnectors = true) #VisioShapeSelectionDuplicates a page-backed selection on the same page.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to duplicate.
- offsetX System.Double = 0.35
- Horizontal offset for duplicated top-level shapes and page-coordinate routing points.
- offsetY System.Double = -0.35
- Vertical offset for duplicated top-level shapes and page-coordinate routing points.
- includeInternalConnectors System.Boolean = true
- Whether connectors between duplicated shapes should also be copied.
Returns
A selection containing the duplicated root shapes.
public static VisioShapeBounds GetShapeBounds(VisioShapeSelection selection) #VisioShapeBoundsGets the page-space bounds for a shape.
Parameters
- shape OfficeIMO.Visio.VisioShape
- Shape to inspect.
public static VisioShapeSelection RelayoutAsGrid(VisioShapeSelection selection, Int32 columns = 0, Double horizontalSpacing = 0.5, Double verticalSpacing = 0.5, Boolean routeInternalConnectors = true) #VisioShapeSelectionRelays out selected shapes into a deterministic grid and optionally reroutes internal connectors.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to relayout.
- columns System.Int32 = 0
- Number of columns. When zero, OfficeIMO uses a near-square grid.
- horizontalSpacing System.Double = 0.5
- Horizontal spacing between columns in inches.
- verticalSpacing System.Double = 0.5
- Vertical spacing between rows in inches.
- routeInternalConnectors System.Boolean = true
- Whether connectors whose endpoints are both selected should be rerouted orthogonally.
public static VisioShapeSelection RelayoutAsGrid(VisioShapeSelection selection, VisioSelectionLayoutOptions options) #VisioShapeSelectionRelays out selected shapes into a deterministic grid and optionally reroutes internal connectors.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to relayout.
- options OfficeIMO.Visio.VisioSelectionLayoutOptions
- Layout options.
public static VisioShapeSelection RelayoutAsHorizontalStack(VisioShapeSelection selection, Double spacing = 0.5, Boolean routeInternalConnectors = true) #VisioShapeSelectionRelays out selected shapes as a horizontal row and optionally reroutes internal connectors.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to relayout.
- spacing System.Double = 0.5
- Horizontal spacing between shapes in inches.
- routeInternalConnectors System.Boolean = true
- Whether connectors whose endpoints are both selected should be rerouted orthogonally.
public static VisioShapeSelection RelayoutAsVerticalStack(VisioShapeSelection selection, Double spacing = 0.5, Boolean routeInternalConnectors = true) #VisioShapeSelectionRelays out selected shapes as a vertical stack and optionally reroutes internal connectors.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to relayout.
- spacing System.Double = 0.5
- Vertical spacing between shapes in inches.
- routeInternalConnectors System.Boolean = true
- Whether connectors whose endpoints are both selected should be rerouted orthogonally.
public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, String masterNameU, Boolean resizeToMaster = false) #VisioShapeSelectionReplaces the master for every shape in a page-backed selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to update.
- masterNameU System.String
- Replacement master universal name.
- resizeToMaster System.Boolean = false
- Whether to resize each shape to the replacement master's default size.
Returns
The updated selection.
public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, VisioMaster master, Boolean resizeToMaster = false) #VisioShapeSelectionReplaces the master for every shape in a page-backed selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to update.
- masterNameU System.String
- Replacement master universal name.
- resizeToMaster System.Boolean = false
- Whether to resize each shape to the replacement master's default size.
Returns
The updated selection.
public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, VisioStencilShape stencil, Boolean resizeToMaster = false) #VisioShapeSelectionReplaces the master for every shape in a page-backed selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to update.
- masterNameU System.String
- Replacement master universal name.
- resizeToMaster System.Boolean = false
- Whether to resize each shape to the replacement master's default size.
Returns
The updated selection.
public static VisioShapeSelection ResizeToText(VisioShapeSelection selection, Nullable<OfficeFontInfo> fontInfo = null, Double horizontalPadding = 0.25, Double verticalPadding = 0.14, Double minimumWidth = 0.5, Double minimumHeight = 0.3) #VisioShapeSelectionResizes a shape to fit its plain text using deterministic OfficeIMO.Drawing measurement.
Parameters
- shape OfficeIMO.Visio.VisioShape
- Shape to resize.
- fontInfo System.Nullable{OfficeIMO.Drawing.OfficeFontInfo} = null
- Font descriptor used for measurement. Uses Office default when omitted.
- horizontalPadding System.Double = 0.25
- Horizontal padding in inches.
- verticalPadding System.Double = 0.14
- Vertical padding in inches.
- minimumWidth System.Double = 0.5
- Minimum resulting width in inches.
- minimumHeight System.Double = 0.3
- Minimum resulting height in inches.