VisioShapeSelection
OfficeIMO.Visio
Editable set of Visio shapes returned by query helpers.
Inheritance
- object
- VisioShapeSelection
Usage
Explore 143 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 84
- Method VisioContainerEditingExtensions.AddToContainer
- Method VisioContainerEditingExtensions.RemoveFromContainer
- Method VisioDuplicationExtensions.Duplicate
- Method VisioDuplicationExtensions.DuplicateShapes
- Method VisioLayoutExtensions.Align
- Method VisioLayoutExtensions.Distribute
- Method VisioLayoutExtensions.DistributeHorizontally
- Method VisioLayoutExtensions.DistributeVertically
- 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.SelectConnectedComponent
- Extension method VisioPage.SelectContainedIn
- Extension method VisioPage.SelectContainers
- Extension method VisioPage.SelectContainingText
- Extension method VisioPage.SelectIntersecting
- Extension method VisioPage.SelectLayer
- Extension method VisioPage.SelectPathBetween
- Extension method VisioPage.SelectShapes
- Extension method VisioPage.SelectWithData
- Extension method VisioPage.SelectWithHyperlink
- Extension method VisioPage.SelectWithHyperlinks
- Extension method VisioPage.SelectWithProtection
- Extension method VisioPage.SelectWithShapeData
- Extension method VisioPage.SelectWithUserCell
- Method VisioPageQueryExtensions.SelectByMaster
- Method VisioPageQueryExtensions.SelectByName
- Method VisioPageQueryExtensions.SelectByNameU
- Method VisioPageQueryExtensions.SelectCallouts
- Method VisioPageQueryExtensions.SelectConnectedComponent
- Method VisioPageQueryExtensions.SelectContainedIn
- Method VisioPageQueryExtensions.SelectContainers
- Method VisioPageQueryExtensions.SelectContainingText
- Method VisioPageQueryExtensions.SelectIntersecting
- Method VisioPageQueryExtensions.SelectLayer
- Method VisioPageQueryExtensions.SelectPathBetween
- Method VisioPageQueryExtensions.SelectShapes
- Method VisioPageQueryExtensions.SelectWithData
- Method VisioPageQueryExtensions.SelectWithHyperlink
- Method VisioPageQueryExtensions.SelectWithHyperlinks
- Method VisioPageQueryExtensions.SelectWithProtection
- Method VisioPageQueryExtensions.SelectWithShapeData
- Method VisioPageQueryExtensions.SelectWithUserCell
- Extension method VisioShapeSelection.AddToContainer
- 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.RelayoutAsHorizontalStack
- Extension method VisioShapeSelection.RelayoutAsVerticalStack
- Extension method VisioShapeSelection.RemoveFromContainer
- 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
- Method VisioStyleExtensions.ApplyStyle
- Method VisioStyleExtensions.ApplyTextStyle
Accepted by parameters 59
- Method VisioContainerEditingExtensions.AddToContainer
- Method VisioContainerEditingExtensions.RemoveFromContainer
- Method VisioContainerEditingExtensions.WrapInContainer
- Method VisioDataGraphicExtensions.AddDataGraphics
- Method VisioDuplicationExtensions.Duplicate
- Method VisioLayoutExtensions.Align
- Method VisioLayoutExtensions.Distribute
- Method VisioLayoutExtensions.DistributeHorizontally
- Method VisioLayoutExtensions.DistributeVertically
- Method VisioLayoutExtensions.GetShapeBounds
- Method VisioLayoutExtensions.RelayoutAsGrid
- Method VisioLayoutExtensions.RelayoutAsHorizontalStack
- Method VisioLayoutExtensions.RelayoutAsVerticalStack
- Method VisioLayoutExtensions.ResizeToText
- Method VisioMasterEditingExtensions.ReplaceMaster
- Method VisioPage.Callouts
- Method VisioPage.ConfigureContainers
- Method VisioPage.ConfigureShapes
- Method VisioPage.ConnectedComponent
- Method VisioPage.DuplicateShape
- Method VisioPage.DuplicateShapes
- Method VisioPage.PathBetween
- Method VisioPage.ShapesByMaster
- Method VisioPage.ShapesByName
- Method VisioPage.ShapesByNameU
- Method VisioPage.ShapesContainedIn
- Method VisioPage.ShapesContainingText
- Method VisioPage.ShapesInLayer
- Method VisioPage.ShapesIntersecting
- Method VisioPage.ShapesWithData
- Method VisioPage.ShapesWithHyperlink
- Method VisioPage.ShapesWithHyperlinks
- Method VisioPage.ShapesWithProtection
- Method VisioPage.ShapesWithShapeData
- Method VisioPage.ShapesWithUserCell
- Extension method VisioShapeSelection.AddDataGraphics
- Extension method VisioShapeSelection.AddToContainer
- Extension method VisioShapeSelection.Align
- Extension method VisioShapeSelection.ApplyStencilMigration
- 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.GetShapeBounds
- Extension method VisioShapeSelection.PlanStencilMigration
- Extension method VisioShapeSelection.RelayoutAsGrid
- Extension method VisioShapeSelection.RelayoutAsHorizontalStack
- Extension method VisioShapeSelection.RelayoutAsVerticalStack
- Extension method VisioShapeSelection.RemoveFromContainer
- Extension method VisioShapeSelection.ReplaceMaster
- Extension method VisioShapeSelection.ResizeToText
- Extension method VisioShapeSelection.WrapInContainer
- Method VisioStencilMigrationExtensions.ApplyStencilMigration
- Method VisioStencilMigrationPlanApplyExtensions.ApplyStencilMigration
- Method VisioStencilMigrationPlanningExtensions.PlanStencilMigration
- 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() #Clears explicit protection settings for every selected shape.
Returns
VisioShapeSelectionpublic VisioShapeSelection Data(string key, string value) #Sets or replaces a data value on every selected shape.
Parameters
- key string
- Data key.
- value string
- Data value.
Returns
VisioShapeSelectionpublic VisioShapeSelection Fill(OfficeColor color, int pattern = 1) #Sets fill color and optional fill pattern on every selected shape.
Parameters
- color OfficeIMO.OfficeColor
- Fill color.
- pattern int = 1
- Fill pattern index.
Returns
VisioShapeSelectionpublic IEnumerator<VisioShape> GetEnumerator() #Returns an enumerator that iterates through the collection.
public VisioShapeSelection Hyperlink(string address, string? description = null, string? subAddress = null) #Adds a hyperlink to every selected shape.
Parameters
- address string
- External hyperlink address.
- description string? = null
- Optional display description.
- subAddress string? = null
- Optional internal sub-address.
Returns
VisioShapeSelectionpublic VisioShapeSelection Layer(string layerName) #Adds every selected shape to a page layer.
Parameters
- layerName string
- Layer name.
Returns
VisioShapeSelectionpublic VisioShapeSelection LineColor(OfficeColor color) #Sets line color on every selected shape.
Parameters
- color OfficeIMO.OfficeColor
- Line color.
Returns
VisioShapeSelectionpublic VisioShapeSelection LinePattern(int pattern) #Sets line pattern on every selected shape.
Parameters
- pattern int
- Line pattern index.
Returns
VisioShapeSelectionpublic VisioShapeSelection LineWeight(double weight) #Sets line weight on every selected shape.
Parameters
- weight double
- Line weight in inches.
Returns
VisioShapeSelectionpublic VisioShapeSelection LockPosition(bool locked = true) #Locks or unlocks position for every selected shape.
Parameters
- locked bool = true
Returns
VisioShapeSelectionpublic VisioShapeSelection LockSize(bool locked = true) #Locks or unlocks size for every selected shape.
Parameters
- locked bool = true
Returns
VisioShapeSelectionpublic VisioShapeSelection MoveBy(double deltaX, double deltaY) #Moves every selected shape by the provided offset.
Parameters
- deltaX double
- Horizontal offset in inches.
- deltaY double
- Vertical offset in inches.
Returns
VisioShapeSelectionpublic VisioShapeSelection Protect(Action<VisioShapeProtection> configure) #Configures protection for every selected shape.
Parameters
- configure System.Action<OfficeIMO.Visio.VisioShapeProtection>
- Protection configuration delegate.
Returns
VisioShapeSelectionpublic VisioShapeSelection ShapeData(string name, string? value, string? label = null, VisioShapeDataType? type = null, string? prompt = null, string? format = null) #Sets or replaces a Visio Shape Data row on every selected shape.
Parameters
- name string
- Shape Data row name.
- value string?
- Shape Data value.
- label string? = null
- Optional label shown in Visio's Shape Data window.
- type OfficeIMO.Visio.VisioShapeDataType? = null
- Optional Shape Data type.
- prompt string? = null
- Optional help prompt.
- format string? = null
- Optional format picture or list values.
Returns
VisioShapeSelectionpublic VisioShapeSelection ShapeData(VisioShapeDataSchema schema, bool overwriteValues = false) #Applies a reusable Shape Data schema on every selected shape.
Parameters
- schema OfficeIMO.Visio.VisioShapeDataSchema
- Shape Data schema to apply.
- overwriteValues bool = false
- Whether schema defaults should replace existing values.
Returns
VisioShapeSelectionpublic VisioShapeSelection Size(OfficeLength width, OfficeLength height) #Resizes every selected shape.
Parameters
- width OfficeIMO.OfficeLength
- New physical width.
- height OfficeIMO.OfficeLength
- New physical height.
Returns
VisioShapeSelectionpublic VisioShapeSelection Stroke(OfficeColor color, double weight = 0.0138889, int pattern = 1) #Sets stroke color, weight, and pattern on every selected shape.
Parameters
- color OfficeIMO.OfficeColor
- Line color.
- weight double = 0.0138889
- Line weight in inches.
- pattern int = 1
- Line pattern index.
Returns
VisioShapeSelectionpublic VisioShapeSelection Style(VisioShapeStyle style) #Applies a reusable shape style on every selected shape.
Parameters
- style OfficeIMO.Visio.VisioShapeStyle
- Shape style to apply.
Returns
VisioShapeSelectionpublic VisioShapeSelection Text(string? text) #Sets text on every selected shape.
Parameters
- text string?
- Text to assign.
Returns
VisioShapeSelectionpublic VisioShapeSelection Text(Func<VisioShape, string?> textFactory) #Updates text on every selected shape from the current shape.
Parameters
- textFactory System.Func<OfficeIMO.Visio.VisioShape, string?>
- Factory returning text for each shape.
Returns
VisioShapeSelectionpublic VisioShapeSelection UserCell(string name, string? value, string? unit = null, string? formula = null, string? prompt = null) #Sets or replaces a Visio User cell on every selected shape.
Parameters
- name string
- User cell row name.
- value string?
- User cell value.
- unit string? = null
- Optional Visio unit code.
- formula string? = null
- Optional ShapeSheet formula.
- prompt string? = null
- Optional prompt value.
Returns
VisioShapeSelectionInherited Methods
Properties
Extension Methods
public static IReadOnlyList<VisioShape> AddDataGraphics(VisioShapeSelection selection, VisioDataGraphic dataGraphic) #Adds visible data graphics for every selected shape.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Target shape selection.
- dataGraphic OfficeIMO.Visio.VisioDataGraphic
- Data graphic definition.
Returns
IReadOnlyList<VisioShape>public static VisioShapeSelection AddToContainer(VisioShapeSelection selection, VisioShape container, bool resizeToFit = true, VisioContainerOptions? resizeOptions = null) #Adds all selected shapes to an existing Visio-native container.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- container OfficeIMO.Visio.VisioShape
- resizeToFit bool = true
- resizeOptions OfficeIMO.Visio.VisioContainerOptions? = null
Returns
VisioShapeSelectionpublic static VisioShapeSelection Align(VisioShapeSelection selection, VisioHorizontalAlignment alignment) #Aligns selected shapes horizontally inside the current selection bounds.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to align.
- alignment OfficeIMO.Visio.VisioHorizontalAlignment
- Horizontal alignment.
Returns
VisioShapeSelectionpublic static VisioShapeSelection Align(VisioShapeSelection selection, VisioVerticalAlignment alignment) #Aligns selected shapes vertically inside the current selection bounds.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to align.
- alignment OfficeIMO.Visio.VisioVerticalAlignment
- Vertical alignment.
Returns
VisioShapeSelectionpublic static VisioStencilMigrationResult ApplyStencilMigration(VisioShapeSelection selection, VisioStencilMigrationMap map) #Applies a stencil migration map to a page-backed shape selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- map OfficeIMO.Visio.VisioStencilMigrationMap
Returns
VisioStencilMigrationResultpublic static VisioStencilMigrationResult ApplyStencilMigration(VisioShapeSelection selection, VisioStencilMigrationPlan plan, VisioStencilMigrationMap map) #Applies a previously reviewed stencil migration plan to a page-backed selection. Every planned shape must still be part of the selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to update.
- plan OfficeIMO.Visio.VisioStencilMigrationPlan
- Reviewed migration plan.
- map OfficeIMO.Visio.VisioStencilMigrationMap
- Migration map used to create the plan.
Returns
VisioStencilMigrationResultpublic static VisioShapeSelection ApplyStyle(VisioShapeSelection selection, VisioShapeStyle style) #Applies a reusable style to a shape selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- style OfficeIMO.Visio.VisioShapeStyle
Returns
VisioShapeSelectionpublic static VisioShapeSelection ApplyTextStyle(VisioShapeSelection selection, VisioTextStyle style) #Applies a reusable text style to a shape selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- style OfficeIMO.Visio.VisioTextStyle
Returns
VisioShapeSelectionpublic static VisioShapeSelection Distribute(VisioShapeSelection selection, VisioDistributionAxis axis) #Distributes selected shapes by center point along the requested axis.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to distribute.
- axis OfficeIMO.Visio.VisioDistributionAxis
- Distribution axis.
Returns
VisioShapeSelectionpublic static VisioShapeSelection DistributeHorizontally(VisioShapeSelection selection) #Distributes selected shapes horizontally by center point.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to distribute.
Returns
VisioShapeSelectionpublic static VisioShapeSelection DistributeVertically(VisioShapeSelection selection) #Distributes selected shapes vertically by center point.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to distribute.
Returns
VisioShapeSelectionpublic static VisioShapeSelection Duplicate(VisioShapeSelection selection, double offsetX = 0.35, double offsetY = -0.35, bool includeInternalConnectors = true) #Duplicates a page-backed selection on the same page.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to duplicate.
- offsetX double = 0.35
- Horizontal offset for duplicated top-level shapes and page-coordinate routing points.
- offsetY double = -0.35
- Vertical offset for duplicated top-level shapes and page-coordinate routing points.
- includeInternalConnectors bool = true
- Whether connectors whose attached shapes are all duplicated should also be copied, including partial connectors.
public static VisioShapeSelection Duplicate(VisioShapeSelection selection, VisioShapeDuplicationOptions? options) #Duplicates a page-backed selection on the same page.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to duplicate.
- options OfficeIMO.Visio.VisioShapeDuplicationOptions?
- Optional duplication settings.
public static VisioShapeBounds GetShapeBounds(VisioShapeSelection selection) #Gets the bounds of a shape selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to inspect.
Returns
VisioShapeBoundspublic static VisioStencilMigrationPlan PlanStencilMigration(VisioShapeSelection selection, VisioStencilMigrationMap map) #Plans a stencil migration map for a page-backed shape selection without modifying the page.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- map OfficeIMO.Visio.VisioStencilMigrationMap
Returns
VisioStencilMigrationPlanpublic static VisioShapeSelection RelayoutAsGrid(VisioShapeSelection selection, int columns = 0, double horizontalSpacing = 0.5, double verticalSpacing = 0.5, bool routeInternalConnectors = true) #Relays out selected shapes into a deterministic grid and optionally reroutes internal connectors.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to relayout.
- columns int = 0
- Number of columns. When zero, OfficeIMO uses a near-square grid.
- horizontalSpacing double = 0.5
- Horizontal spacing between columns in inches.
- verticalSpacing double = 0.5
- Vertical spacing between rows in inches.
- routeInternalConnectors bool = true
- Whether connectors whose endpoints are both selected should be rerouted orthogonally.
Returns
VisioShapeSelectionpublic static VisioShapeSelection RelayoutAsGrid(VisioShapeSelection selection, VisioSelectionLayoutOptions? options) #Relays 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.
Returns
VisioShapeSelectionpublic static VisioShapeSelection RelayoutAsHorizontalStack(VisioShapeSelection selection, double spacing = 0.5, bool routeInternalConnectors = true) #Relays out selected shapes as a horizontal row and optionally reroutes internal connectors.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to relayout.
- spacing double = 0.5
- Horizontal spacing between shapes in inches.
- routeInternalConnectors bool = true
- Whether connectors whose endpoints are both selected should be rerouted orthogonally.
Returns
VisioShapeSelectionpublic static VisioShapeSelection RelayoutAsVerticalStack(VisioShapeSelection selection, double spacing = 0.5, bool routeInternalConnectors = true) #Relays out selected shapes as a vertical stack and optionally reroutes internal connectors.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to relayout.
- spacing double = 0.5
- Vertical spacing between shapes in inches.
- routeInternalConnectors bool = true
- Whether connectors whose endpoints are both selected should be rerouted orthogonally.
Returns
VisioShapeSelectionpublic static VisioShapeSelection RemoveFromContainer(VisioShapeSelection selection, VisioShape container, bool resizeToFit = true, VisioContainerOptions? resizeOptions = null) #Removes all selected shapes from an existing Visio-native container.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- container OfficeIMO.Visio.VisioShape
- resizeToFit bool = true
- resizeOptions OfficeIMO.Visio.VisioContainerOptions? = null
Returns
VisioShapeSelectionpublic static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, string masterNameU, bool resizeToMaster = false) #Replaces the master for every shape in a page-backed selection.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to update.
- masterNameU string
- Replacement master universal name.
- resizeToMaster bool = false
- Whether to resize each shape to the replacement master's default size.
public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, VisioMaster master, bool resizeToMaster = false) #Replaces the master for every shape in a page-backed selection using an existing master instance.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to update.
- master OfficeIMO.Visio.VisioMaster
- Replacement master.
- resizeToMaster bool = false
- Whether to resize each shape to the replacement master's default size.
public static VisioShapeSelection ReplaceMaster(VisioShapeSelection selection, VisioStencilShape stencil, bool resizeToMaster = false) #Replaces the master for every shape in a page-backed selection using an OfficeIMO-native stencil definition.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to update.
- stencil OfficeIMO.Visio.Stencils.VisioStencilShape
- Replacement stencil definition.
- resizeToMaster bool = false
- Whether to resize each shape to the stencil's default size.
public static VisioShapeSelection ResizeToText(VisioShapeSelection selection, OfficeFontInfo? fontInfo = null, double horizontalPadding = 0.25, double verticalPadding = 0.14, double minimumWidth = 0.5, double minimumHeight = 0.3) #Resizes selected shapes to fit their plain text using deterministic OfficeIMO.Drawing measurement.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- Selection to resize.
- fontInfo OfficeIMO.Drawing.OfficeFontInfo? = null
- Font descriptor used for measurement. Uses Office default when omitted.
- horizontalPadding double = 0.25
- Horizontal padding in inches.
- verticalPadding double = 0.14
- Vertical padding in inches.
- minimumWidth double = 0.5
- Minimum resulting width in inches.
- minimumHeight double = 0.3
- Minimum resulting height in inches.
Returns
VisioShapeSelectionpublic static VisioShape WrapInContainer(VisioShapeSelection selection, string id, string text, VisioContainerOptions? options = null) #Creates a Visio-native container around the selected shapes.
Parameters
- selection OfficeIMO.Visio.VisioShapeSelection
- id string
- text string
- options OfficeIMO.Visio.VisioContainerOptions? = null
Returns
VisioShape