Class Shape

Shape class

Contains elements that define a shape in a Master, Page, or group shape element.

public class Shape

Constructors

NameDescription
Shape()Constructor.

Properties

NameDescription
ActiveXControl { get; }Gets the ActiveX control.
Acts { get; }Contains a collection of Act elements.
Align { get; }Indicates the alignment of a shape with respect to the guide or guide point to which the shape is glued. The Align element appears only for shapes that are glued to guides or guide points.
Chars { get; }Contains a collection of Char elements.
ClippingPath { get; set; }
ConnectionABCDs { get; }Contains a collection of ConnectionABCD elements.
Connections { get; }Contains a collection of Connection elements.
ControlData { get; }Gets the data of control.
Controls { get; }Contains a collection of Control elements.
Data1 { get; set; }Contains an arbitrary string value that is used to supply additional information about a shape.
Data2 { get; set; }Contains an arbitrary string value that is used to supply additional information about a shape.
Data3 { get; set; }Contains an arbitrary string value that is used to supply additional information about a shape.
Del { get; set; }A flag indicating whether the element is deleted locally. A value of 1 indicates that the element is deleted locally.
Diagram { get; set; }Root element of Visio objects hierarchy.
Event { get; set; }Contains elements that specify formulas that control shape events.
Fields { get; }Contains a collection of Field elements.
Fill { get; }Contains the current fill formatting values for the shape and the shape’s drop shadow, including pattern, foreground color, and background color.
FillStyle { get; set; }StyleSheet from which this shape inherits fill formatting.
Foreign { get; }Contains elements specifying the width and height of an object from another program used in a Microsoft Visio document. Also includes elements specifying the distance the object’s image is offset within its borders.
ForeignData { get; }Contains a MIME (Multipurpose Internet Mail Extensions) encoded BLOB of picture data, such as Windows metafile, bitmap, or OLE data.
Geoms { get; }Contains a collection of Geom elements.
Group { get; }Contains elements that control how you add shapes to a group, move members of a group, and select groups.
Help { get; }Contains elements specifying the Shape element’s Help file topic and copyright information.
Hyperlinks { get; }Contains a collection of Hyperlink elements.
ID { get; set; }The unique ID of the element within its parent element.
Image { get; }Contains the gamma, brightness, contrast, blur, sharpen, denoise, and transparency values for a bitmap.
InheritChars { get; }Contains the char values for the shape inherit by the master shape.
InheritFill { get; }Contains the fill formatting values for the shape inherit by the parent style and the master shape.
InheritGeoms { get; }Contains the Geoms values for the shape inherit by the master shape.
InheritGroup { get; }
InheritLine { get; }Contains the line formatting values for the shape inherit by the parent style and the master shape.
InheritParas { get; }Contains the paras for the shape inherit by the parent style and the master shape.
InheritProps { get; }Contains the props for the shape inherit by the master shape.
InheritTextBlock { get; }Contains the textblock values for the shape inherit by the parent style and the master shape.
InheritUsers { get; }Contains the users for the shape inherit by the master shape.
IsTextEmpty { get; }Indicate the shape has text and the text is empty or not.
LayerMem { get; }Contains the LayerMember element, which specifies each layer to which the shape is assigned.
Layout { get; }Contains elements that control shape placement and connector routing settings.
Line { get; }Contains elements that control line attributes for a shape, such as pattern, weight, and color. These elements determine whether the line ends are formatted (for example, with an arrowhead), the size of line end formats, radius of the rounding circle applied to the line, and line cap style (round or square).
LineStyle { get; set; }StyleSheet from which this shape inherits line formatting
Master { get; set; }The Master from which the shape inherits its data.
MasterShape { get; set; }This attribute may only be present in shapes that are members of a group shape, and the group is an instance of a master. The attribute contains an ID that references the corresponding sub-shape in the master.
Misc { get; }Contains elements specifying the Shape element’s Help file topic and copyright information.
Name { get; set; }The name of the element.
NameU { get; set; }The universal name of the element.
OneD { get; }Determines whether the shape behaves as a one-dimensional (1-D) object. Read-only.
Page { get; set; }Root element of Visio objects hierarchy.
Paras { get; }Contains a collection of Para elements.
ParentShape { get; set; }Shape’s parent.
PresetTheme { set; }Apply a preset theme to this shape
PresetThemeQuickStyle { set; }Apply a preset theme variant quickstyle to this shape
PresetThemeVariant { set; }Apply a preset theme variant to this shape
Props { get; set; }Contains a collection of Prop elements.
Protection { get; }Locking helps prevent inadvertent changes to the shape but does not prevent Microsoft Visio from resetting values in other circumstances. It also does not protect against changes made in the ShapeSheet window.
RootShape { get; }Returns the top-level shape of an instance if this shape is part of a master instance. Read-only.
Scratchs { get; }Contains a collection of Scratch elements.
Shapes { get; }Contains a collection of Shape elements.
SmartTagDefs { get; }Contains a collection of SmartTagDef elements.
TabsCollection { get; }Contains a collection of Tab elements.
Text { get; set; }Contains the text of a shape.
TextBlock { get; }Contains elements that specify the alignment, margins, and default tab stop positions of text in a shape’s text block.
TextStyle { get; set; }StyleSheet from which this shape inherits text formatting.
TextXForm { get; }Contains elements that specify positioning information about a shape’s text block.
ThreeDFormat { get; }Gets the ThreeDFormat.
TwoD { get; set; }Determines whether the shape behaves as a two-dimensional (2-D) object.
Type { get; set; }The type of a shape. It may be one of the following values: Group, Shape, Guide, or Foreign.
UniqueID { get; set; }A GUID (globally unique identifier) assigned to the shape.
Users { get; }Contains a collection of User elements.
XForm { get; set; }Contains elements specifying general positioning information about a shape.
XForm1D { get; set; }Contains x- and y-coordinates of the begin point and end point of a 1-D shape. This element appears for 1-D shapes only.
ZOrderIndex { get; }Returns the index of a shape in the z-order except the guide shape.

Methods

NameDescription
BringForward()Brings the shape forward one position in the z-order.
BringToFront()Brings the shape to the front of the z-order.
CenterDrawing()Center the shape with respect to the extent of the page
ConnectedShapes(ConnectedShapesFlags, string)Returns an array that contains the identifiers (IDs) of the shapes that are connected to the shape.
ConvertToGroup()Converts a selection or an object from another application (a linked or embedded object) to a group.
Copy(Shape)
DependsOnShapes()Returns an array that contains the identifiers of the shapes that are depends on a shape.
GetConnectorRule()Returns a connectorRule that contains the shape id and connecton that are connected to the shape.
GetConnectorsType()Get Connectors type
GetDisplayText()Get the text displayed on the interface
GetPureText()Get the text string
GetRelationFlag(Shape)Returns RelationFlag that represents the relationship of one shape to another shape.
GetRelationShapeCollection()Returns RelationShapeCollection that represents the relationshapes of one shape.
GluedShapes(GluedShapesFlags, string, Shape)Returns an array that contains the identifiers of the shapes that are glued to a shape.
IsConnected(Shape)Indicates whether this two shapes are connected.
IsContain(Shape)Indicates whether this shape is contain another shape.
IsGlued(Shape)Indicates whether this two shapes are glued.
IsInGroup()Indicates whether this shape is in a group shape.
IsIntersect(Shape)Indicates whether this shape is intersect another shape.
Move(double, double)Moves shape on the dX and dY inches from current position.
MoveTo(double, double)Moves shape on new absolute position on the page.
RefreshData()Refreshes shape’s position including xform ,connection and geom when changing shape’s text or other’s .
ReplaceText(string, string)Replace the text string of a shape .
SendBackward()Moves the shape back one position in the z-order.
SendToBack()Moves the shape to the back of the z-order.
SetAngle(double)Sets new angle of shape. The angle’s unit is radian.
SetConnectorsType(ConnectorsTypeValue)Set Connectors type
SetHeight(double)Sets new height of shape.
SetPresetThemeStyleMatrics(PresetStyleMatricsValue, PresetColorMatricsValue)pply a preset theme variant quickstyle to this shape, like theme styles options in shape styles dropdown list
SetWidth(double)Sets new width of shape.
ToHTML(Stream, HTMLSaveOptions)Creates the shape html and saves it to a stream in the specified format.
ToHTML(string, HTMLSaveOptions)Creates the html and saves it to a file.
ToImage(Stream, ImageSaveOptions)Creates the shape image and saves it to a stream in the specified format.
ToImage(string, ImageSaveOptions)Creates the shape image and saves it to a file. The extension of the file name determines the format of the image.
ToPdf(Stream)Creates the shape pdf and saves it to a stream.
ToPdf(string)Saves the shape to a pdf file.
ToSvg(string, SVGSaveOptions)Saves the shape to a svg file.
Ungroup()Ungroup Shape

See Also