OfficeIMO

API Reference

Class

VisioShape

Namespace OfficeIMO.Visio
Assembly OfficeIMO.Visio

Represents a shape on a Visio page.

Inheritance

  • Object
  • VisioShape

Constructors

VisioShape 2 overloads
public VisioShape(String id) #

Initializes a new instance of the VisioShape class with the specified identifier.

Parameters

id System.String requiredposition: 0
Identifier of the shape.
public VisioShape(String id, Double pinX, Double pinY, Double width, Double height, String text) #

Initializes a new instance of the VisioShape class.

Parameters

id System.String requiredposition: 0
Identifier of the shape.
pinX System.Double requiredposition: 1
X coordinate of the pin.
pinY System.Double requiredposition: 2
Y coordinate of the pin.
width System.Double requiredposition: 3
Width of the shape.
height System.Double requiredposition: 4
Height of the shape.
text System.String requiredposition: 5
Text contained within the shape.

Methods

EnsureSideConnectionPoints() #

Ensures the shape has four side connection points (Left, Right, Bottom, Top). If they already exist (>=4), nothing is added. Internal: users should not call this; side points are added automatically by the connector API when explicit sides are requested.

public VisioShape FindDescendantById(String id) #
Returns: VisioShape

Recursively searches the shape hierarchy for a shape with the provided identifier.

Parameters

id System.String requiredposition: 0
Identifier to locate.

Returns

The matching shape when found; otherwise null.

public ValueTuple<Double, Double> GetAbsolutePoint(Double x, Double y) #
Returns: ValueTuple<Double, Double>

Transforms a point from the shape's local coordinate system to the page coordinate system.

Parameters

x System.Double requiredposition: 0
X coordinate of the point relative to the shape's local coordinate system.
y System.Double requiredposition: 1
Y coordinate of the point relative to the shape's local coordinate system.

Returns

The point's absolute coordinates on the page.

public ValueTuple<Double, Double, Double, Double> GetBounds() #
Returns: ValueTuple<Double, Double, Double, Double>

Computes the absolute bounds of the shape on the page.

Properties

public String Id { get; } #

Identifier of the shape.

PersistedId #

Identifier stored in the package when different from Id.

public String Name { get; set; } #

Gets or sets the shape name.

public String NameU { get; set; } #

Gets or sets the universal name of the shape.

public String Type { get; set; } #

Gets or sets the Visio type of the shape (for example "Group").

public VisioMaster Master { get; set; } #

Gets or sets the master associated with the shape.

public String MasterShapeId { get; set; } #

Gets the identifier of the referenced master shape when Master is defined.

public VisioShape MasterShape { get; set; } #

Gets the master shape instance referenced by MasterShapeId, if any.

public String MasterNameU { get; } #

Gets the universal name of the master.

public Double PinX { get; set; } #

Gets or sets the X coordinate of the pin.

public Double PinY { get; set; } #

Gets or sets the Y coordinate of the pin.

public Double Width { get; set; } #

Gets or sets the width of the shape.

public Double Height { get; set; } #

Gets or sets the height of the shape.

public Double LineWeight { get; set; } #

Gets or sets the line weight of the shape.

public Double LocPinX { get; set; } #

Gets or sets the X coordinate of the local pin.

public Double LocPinY { get; set; } #

Gets or sets the Y coordinate of the local pin.

public Double Angle { get; set; } #

Gets or sets the rotation angle of the shape in radians.

public String Text { get; set; } #

Gets or sets the text contained in the shape.

public Color LineColor { get; set; } #

Line (border) color of the shape.

public Color FillColor { get; set; } #

Fill color of the shape.

public Int32 LinePattern { get; set; } #

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

public Int32 FillPattern { get; set; } #

Fill pattern (0=None, 1=Solid, etc.).

public VisioShape Parent { get; set; } #

Parent shape when part of a group hierarchy.

public IList<VisioShape> Children { get; } #

Child shapes when this shape represents a group.

public IList<VisioConnectionPoint> ConnectionPoints { get; } #

Connection points associated with the shape.

PreservedGeometrySections #

Geometry sections captured from a loaded package so custom shape outlines can be preserved on save.

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

Arbitrary data associated with the shape.

Fields

DefaultLineWeight #

Default line weight used when Visio does not specify a value.