Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

VisioConnector

OfficeIMO.Visio

Namespace
OfficeIMO.Visio
Assembly
OfficeIMO.Visio
Source revision
0eef6a5756b9 with working tree changes

Connects attached shapes or free page points.

Inheritance

  • object
  • VisioConnector

Usage

Explore 117 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 74

Accepted by parameters 43

Constructors

VisioConnector 3 overloads
public VisioConnector(VisioShape from, VisioShape to) #

Initializes a new instance of the VisioConnector class connecting two shapes.

Parameters

from OfficeIMO.Visio.VisioShape required
Shape from which the connector starts.
to OfficeIMO.Visio.VisioShape required
Shape at which the connector ends.
public VisioConnector(string id, VisioShape from, VisioShape to) #

Initializes a new instance of the VisioConnector class with an explicit identifier.

Parameters

id string required
Identifier of the connector.
from OfficeIMO.Visio.VisioShape required
Shape from which the connector starts.
to OfficeIMO.Visio.VisioShape required
Shape at which the connector ends.
public VisioConnector(string id, OfficePoint start, OfficePoint end) #

Creates a connector between free page points expressed in inches.

Parameters

id string required
start OfficeIMO.Drawing.OfficePoint required
end OfficeIMO.Drawing.OfficePoint required

Methods

AddHyperlink 2 overloads
public VisioConnector ClearProtection() #

Clears explicit ShapeSheet protection cells from this connector.

public VisioConnector ClearRoutingPolicy() #

Clears explicit Shape Layout routing override cells from this connector.

public VisioShapeDataRow? FindShapeData(string name) #

Finds a Shape Data row by row name.

Parameters

name string required
Shape Data row name.
public VisioConnector FromSide(VisioSide side) #

Connects the start of the connector to an explicit side.

Parameters

side OfficeIMO.Visio.VisioSide required
Preferred source side.
public string? GetShapeDataValue(string name) #

Gets a Shape Data value by row name.

Parameters

name string required
Shape Data row name.

Returns

string?
public VisioConnector LockEndpoints(bool locked = true) #

Locks or unlocks connector endpoints.

Parameters

locked bool = true optional
public VisioConnector Protect(Action<VisioProtection> configure) #

Configures ShapeSheet protection cells for this connector.

Parameters

configure System.Action<OfficeIMO.Visio.VisioProtection> required
Protection configuration delegate.
public VisioConnector SetArrowEnd(EndArrow arrow) #

Sets an end arrowhead style.

Parameters

arrow OfficeIMO.Visio.EndArrow required
Arrowhead enum value.
public VisioConnector SetArrowStart(EndArrow arrow) #

Sets a begin arrowhead style.

Parameters

arrow OfficeIMO.Visio.EndArrow required
Arrowhead enum value.
public VisioConnector SetBaseline(OfficeTextBaseline baseline) #

Sets the native connector-label baseline placement.

Parameters

baseline OfficeIMO.Drawing.OfficeTextBaseline required
public VisioConnector SetBold(bool enabled = true) #

Sets whether the connector label is bold.

Parameters

enabled bool = true optional
public VisioConnector SetCapitalization(VisioTextCapitalization capitalization) #

Sets the native connector-label capitalization mode.

Parameters

capitalization OfficeIMO.Visio.VisioTextCapitalization required
public VisioConnector SetFont(string fontFamily) #

Sets the connector-label font family.

Parameters

fontFamily string required
public VisioConnector SetFontSize(double size) #

Sets the connector-label font size in points.

Parameters

size double required
public VisioConnector SetItalic(bool enabled = true) #

Sets whether the connector label is italic.

Parameters

enabled bool = true optional
public VisioConnector SetKind(ConnectorKind kind) #

Sets the native connector routing kind.

Parameters

kind OfficeIMO.Visio.ConnectorKind required
SetLabel 2 overloads
public VisioConnector SetLabel(string text) #

Sets a connector label.

Parameters

text string required
Label text.
public VisioConnector SetLabel(string text, double position, double offsetX = 0, double offsetY = 0) #

Sets a connector label and places it along the connector path.

Parameters

text string required
Label text.
position double required
Position along the connector path, from 0.0 to 1.0.
offsetX double = 0 optional
Horizontal page-coordinate offset.
offsetY double = 0 optional
Vertical page-coordinate offset.
public VisioConnector SetLayer(string layerName) #

Adds the connector to a page layer.

Parameters

layerName string required
Layer name.
public VisioConnector SetLineColor(OfficeColor color) #

Sets connector line color.

Parameters

color OfficeIMO.OfficeColor required
Line color.
public VisioConnector SetLineJumps(VisioLineJumpStyle style, VisioConnectorLineJumpCode code, VisioHorizontalLineJumpDirection horizontalDirection = Default, VisioVerticalLineJumpDirection verticalDirection = Default) #

Sets connector-level line jump behavior.

Parameters

style OfficeIMO.Visio.VisioLineJumpStyle required
code OfficeIMO.Visio.VisioConnectorLineJumpCode required
horizontalDirection OfficeIMO.Visio.VisioHorizontalLineJumpDirection = Default optional
verticalDirection OfficeIMO.Visio.VisioVerticalLineJumpDirection = Default optional
public VisioConnector SetLinePattern(int pattern) #

Sets connector line pattern (Visio pattern index).

Parameters

pattern int required
Pattern index (0=None, 1=Solid, ...).
public VisioConnector SetLineWeight(double weight) #

Sets connector line weight (thickness) in inches.

Parameters

weight double required
Line weight in inches.
public VisioConnector SetRerouteBehavior(VisioConnectorRerouteBehavior behavior) #

Sets when Visio may reroute this connector.

Parameters

behavior OfficeIMO.Visio.VisioConnectorRerouteBehavior required
public VisioConnector SetRouteAppearance(VisioLineRouteExtension appearance) #

Sets the connector-level routed connector appearance.

Parameters

appearance OfficeIMO.Visio.VisioLineRouteExtension required
public VisioConnector SetRouteStyle(VisioPageRouteStyle style) #

Sets the connector-level Visio routing style.

Parameters

style OfficeIMO.Visio.VisioPageRouteStyle required
public VisioShapeDataRow SetShapeData(string name, string? value, string? label = null, VisioShapeDataType? type = null, string? prompt = null, string? format = null) #

Sets or creates a Shape Data row.

Parameters

name string required
Shape Data row name.
value string? required
Shape Data value.
label string? = null optional
Optional label shown in Visio's Shape Data window.
type OfficeIMO.Visio.VisioShapeDataType? = null optional
Optional Shape Data type.
prompt string? = null optional
Optional help prompt.
format string? = null optional
Optional format picture or list values.
public VisioConnector SetStrikethrough(OfficeTextDecorationStyle style = Single) #

Sets the native connector-label strikethrough variant.

Parameters

style OfficeIMO.Drawing.OfficeTextDecorationStyle = Single optional
public VisioConnector SetTextColor(OfficeColor color) #

Sets the connector-label text color.

Parameters

color OfficeIMO.OfficeColor required
public VisioConnector SetUnderline(OfficeTextDecorationStyle style = Single) #

Sets the native connector-label underline variant.

Parameters

style OfficeIMO.Drawing.OfficeTextDecorationStyle = Single optional
public VisioConnector Sides(VisioSide fromSide, VisioSide toSide) #

Connects both ends to explicit shape sides.

Parameters

fromSide OfficeIMO.Visio.VisioSide required
Preferred source side.
toSide OfficeIMO.Visio.VisioSide required
Preferred target side.
public VisioConnector ToSide(VisioSide side) #

Connects the end of the connector to an explicit side.

Parameters

side OfficeIMO.Visio.VisioSide required
Preferred target side.
public VisioConnector TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null) #

Transforms the stored connector label while preserving connector and text formatting.

Parameters

textCase OfficeIMO.Drawing.OfficeTextCase required
culture System.Globalization.CultureInfo? = null optional

Properties

public string Id { get; internal set; } #

Identifier of the connector.

public VisioShape? From { get; internal set; } #

Attached source shape, or null when the start is a free page point.

public VisioShape? To { get; internal set; } #

Attached target shape, or null when the end is a free page point.

public VisioConnectionPoint? FromConnectionPoint { get; set; } #

Connection point on the starting shape. Setting null selects automatic attachment.

public VisioConnectionPoint? ToConnectionPoint { get; set; } #

Connection point on the ending shape. Setting null selects automatic attachment.

public ConnectorKind Kind { get; set; } #

Gets or sets the kind of connector.

public EndArrow? BeginArrow { get; set; } #

Gets or sets the arrow style at the beginning of the connector.

public EndArrow? EndArrow { get; set; } #

Gets or sets the arrow style at the end of the connector.

public string? Label { get; set; } #

Optional label displayed alongside the connector.

public VisioConnectorLabelPlacement? LabelPlacement { get; set; } #

Optional placement information for connector text.

public VisioTextStyle? TextStyle { get; set; } #

Gets or sets whole-label text formatting for this connector.

public IList<VisioConnectorWaypoint> Waypoints { get; } #

Explicit page-coordinate waypoints between the start and end of the connector.

public ISet<string> LayerNames { get; } #

Page layer names this connector belongs to.

public IList<VisioShapeDataRow> ShapeData { get; } #

Visio Shape Data rows attached to this connector.

public Dictionary<string, string> Data { get; } #

Arbitrary data associated with the connector.

public VisioProtection Protection { get; } #

Visio ShapeSheet protection cells controlling interactive connector editing in Visio.

public VisioPageRouteStyle? RouteStyle { get; set; } #

Gets or sets the connector-level Visio routing style. When null, Visio uses the page default.

public VisioLineRouteExtension? RouteAppearance { get; set; } #

Gets or sets the connector-level appearance for routed connectors.

public VisioLineJumpStyle? LineJumpStyle { get; set; } #

Gets or sets the connector-level line jump style.

public VisioConnectorLineJumpCode? LineJumpCode { get; set; } #

Gets or sets when this connector receives line jumps.

public VisioHorizontalLineJumpDirection? HorizontalJumpDirection { get; set; } #

Gets or sets the jump direction for horizontal segments of this connector.

public VisioVerticalLineJumpDirection? VerticalJumpDirection { get; set; } #

Gets or sets the jump direction for vertical segments of this connector.

public VisioConnectorRerouteBehavior? RerouteBehavior { get; set; } #

Gets or sets when Visio may reroute this connector.

public OfficeColor LineColor { get; set; } #

Line color of the connector.

public double LineWeight { get; set; } #

Line weight (thickness) of the connector.

public int LinePattern { get; set; } #

Line pattern (0=None, 1=Solid, 2=Dashed, etc.).

public OfficePoint StartPoint { get; set; } #

Resolved start in page inches. Setting this value detaches the source end.

public OfficePoint EndPoint { get; set; } #

Resolved end in page inches. Setting this value detaches the target end.

Extension Methods

public static VisioConnector ApplyStyle(VisioConnector connector, VisioConnectorStyle style) #

Applies a reusable style to a connector.

Parameters

connector OfficeIMO.Visio.VisioConnector required
style OfficeIMO.Visio.VisioConnectorStyle required
public static VisioConnector ApplyTextStyle(VisioConnector connector, VisioTextStyle style) #

Applies a reusable text style to a connector label.

Parameters

connector OfficeIMO.Visio.VisioConnector required
style OfficeIMO.Visio.VisioTextStyle required
public static VisioConnector ClearRoute(VisioConnector connector) #

Removes explicit connector waypoints and returns the connector to dynamic routing.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector to reset.
public static VisioShapeBounds GetConnectorContentBounds(VisioConnector connector) #

Gets connector route and label bounds in page inches.

Parameters

connector OfficeIMO.Visio.VisioConnector required
public static VisioShapeBounds GetLabelBounds(VisioConnector connector) #

Gets the explicitly placed connector label bounds in page inches, or empty bounds when no label is placed.

Parameters

connector OfficeIMO.Visio.VisioConnector required
public static IReadOnlyList<VisioShapeSheetSection> GetShapeSheetSections(VisioConnector connector) #

Returns source-preserved ShapeSheet sections, including native text rows with current typed edits.

Parameters

connector OfficeIMO.Visio.VisioConnector required

Returns

IReadOnlyList<VisioShapeSheetSection>
public static VisioConnector PlaceLabel(VisioConnector connector, double position = 0.5, double offsetX = 0, double offsetY = 0, double width = 1.25, double height = 0.3) #

Places connector text along the connector path.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector whose label should be placed.
position double = 0.5 optional
Position along the connector path, from 0.0 to 1.0.
offsetX double = 0 optional
Horizontal page-coordinate offset.
offsetY double = 0 optional
Vertical page-coordinate offset.
width double = 1.25 optional
Label text box width in page units.
height double = 0.3 optional
Label text box height in page units.
public static VisioConnector PlaceLabelAt(VisioConnector connector, double pinX, double pinY, double width = 1.25, double height = 0.3) #

Places connector text at an absolute page coordinate.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector whose label should be placed.
pinX double required
Text pin X coordinate.
pinY double required
Text pin Y coordinate.
width double = 1.25 optional
Label text box width in page units.
height double = 0.3 optional
Label text box height in page units.
public static bool RemoveShapeSheetSection(VisioConnector connector, string name) #

Removes a source-preserved section and clears any typed formatting owned by that text section.

Parameters

connector OfficeIMO.Visio.VisioConnector required
name string required

Returns

bool
public static VisioConnector ResizeLabelToText(VisioConnector connector, OfficeFontInfo? fontInfo = null, double horizontalPadding = 0.12, double verticalPadding = 0.06, double minimumWidth = 0.45, double minimumHeight = 0.22, double? maximumWidth = null) #

Resizes a connector label text box to fit its plain text using deterministic OfficeIMO.Drawing measurement.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector whose label box should be resized.
fontInfo OfficeIMO.Drawing.OfficeFontInfo? = null optional
Font descriptor used for measurement. Uses connector text style, then Office default, when omitted.
horizontalPadding double = 0.12 optional
Horizontal padding in inches.
verticalPadding double = 0.06 optional
Vertical padding in inches.
minimumWidth double = 0.45 optional
Minimum resulting label width in inches.
minimumHeight double = 0.22 optional
Minimum resulting label height in inches.
maximumWidth double? = null optional
Optional maximum label width in inches. Text wraps by words when supplied.
public static VisioConnector RouteOrthogonal(VisioConnector connector, VisioConnectorRouteStyle style = Auto, double offset = 0) #

Generates a clean three-segment orthogonal route between connector endpoints.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector to route.
style OfficeIMO.Visio.VisioConnectorRouteStyle = Auto optional
Orthogonal route orientation.
offset double = 0 optional
Optional offset applied to the center routing lane.
RouteOrthogonalAroundShapes 2 overloads
public static VisioConnector RouteOrthogonalAroundShapes(VisioConnector connector, IEnumerable<VisioShape> obstacles, double padding = 0.15, int maxLanes = 12) #

Generates an orthogonal route that avoids unrelated obstacle shapes when a clear lane is available.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector to route.
obstacles System.Collections.Generic.IEnumerable<OfficeIMO.Visio.VisioShape> required
Shapes that the route should avoid. Source, target, containers, background surfaces, and generated adornments are ignored.
padding double = 0.15 optional
Padding added around each obstacle while testing route intersections.
maxLanes int = 12 optional
Number of positive and negative routing lanes to try on each axis.
public static VisioConnector RouteOrthogonalAroundShapes(VisioConnector connector, IEnumerable<VisioShape> obstacles, VisioConnectorRoutingOptions options) #

Generates an orthogonal route that avoids unrelated obstacle shapes when a clear lane is available.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector to route.
obstacles System.Collections.Generic.IEnumerable<OfficeIMO.Visio.VisioShape> required
Shapes that the route should avoid. Source and target shapes are ignored.
options OfficeIMO.Visio.VisioConnectorRoutingOptions required
Routing options controlling padding, lane search, and whether zones/containers count as obstacles.
public static VisioConnector RouteSelfLoop(VisioConnector connector, double clearance = 0.35) #

Routes a connector from a shape back to itself as an external orthogonal loop.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Self-connector to route.
clearance double = 0.35 optional
Clearance outside the shape bounds, in page units.
RouteThrough 2 overloads
public static VisioConnector RouteThrough(VisioConnector connector, params VisioConnectorWaypoint[] waypoints) #

Replaces connector geometry with finite page-coordinate waypoints after validating the entire input.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector to route.
waypoints OfficeIMO.Visio.VisioConnectorWaypoint[] required
Absolute page coordinates between start and end.
public static VisioConnector RouteThrough(VisioConnector connector, IEnumerable<VisioConnectorWaypoint> waypoints) #

Replaces connector geometry with finite page-coordinate waypoints after validating the entire input. Invalid entries or a failed enumeration leave the previous route intact.

Parameters

connector OfficeIMO.Visio.VisioConnector required
Connector to route.
waypoints System.Collections.Generic.IEnumerable<OfficeIMO.Visio.VisioConnectorWaypoint> required
Absolute page coordinates between start and end.
public static VisioConnector SetShapeSheetSection(VisioConnector connector, VisioShapeSheetSection section) #

Sets a typed ShapeSheet section without disturbing other preserved sections.

Parameters

connector OfficeIMO.Visio.VisioConnector required
section OfficeIMO.Visio.VisioShapeSheetSection required