Shape
Contents
[
Hide
]Shape class
Contains elements that define a shape in a Master, Page, or group shape element.
Shape()
Constructor.
Properties
| Name | Type | Description |
|---|---|---|
| ID | long | The unique ID of the element within its parent element. |
| Del | int | A flag indicating whether the element is deleted locally. A value of 1 indicates that the element is deleted locally. Th |
| UniqueID | UUID | A GUID (globally unique identifier) assigned to the shape. |
| Name | String | The name of the element. |
| NameU | String | The universal name of the element. |
| Type | int | The type of a shape. It may be one of the following values: Group, Shape, Guide, or Foreign. The value of the property i |
| LineStyle | StyleSheet | StyleSheet from which this shape inherits line formatting |
| FillStyle | StyleSheet | StyleSheet from which this shape inherits fill formatting. |
| TextStyle | StyleSheet | StyleSheet from which this shape inherits text formatting. |
| Shapes | ShapeCollection | Contains a collection of Shape elements. |
| Text | Text | Contains the text of a shape. |
| XForm | XForm | Contains elements specifying general positioning information about a shape. |
| Line | Line | Contains elements that control line attributes for a shape, such as pattern, weight, and color. These elements determine |
| Fill | Fill | Contains the current fill formatting values for the shape and the shape’s drop shadow, including pattern, foreground col |
| HasThemeColor | boolean | Gets whether the shape has theme color. |
| InheritChars | CharCollection | Contains the char values for the shape inherit by the master shape. |
| InheritProps | PropCollection | Contains the props for the shape inherit by the master shape. |
| InheritFields | FieldCollection | Contains the fields for the shape inherit by the master shape. |
| InheritActs | ActCollection | Contains the actions for the shape inherit by the master shape. |
| InheritHyperlinks | HyperlinkCollection | Contains the Hyperlinks for the shape inherit by the master shape. |
| InheritXForm | XForm | |
| InheritXForm1D | XForm1D | |
| InheritMisc | Misc | Contains the Misc for the shape inherit by the master shape. |
| InheritProtection | Protection | Contains the Protection for the shape inherit by the master shape. |
| InheritEvent | Event | Contains the Event for the shape inherit by the master shape. |
| InheritLayerMem | LayerMem | Contains the LayerMem for the shape inherit by the master shape. |
| InheritHelp | Help | Contains the Help for the shape inherit by the master shape. |
| InheritLayout | Layout | Contains the Layout for the shape inherit by the master shape. |
| InheritControls | ControlCollection | Contains the controls for the shape inherit by the master shape. |
| InheritConnections | ConnectionCollection | Contains the connections for the shape inherit by the master shape. |
| InheritScratchs | ScratchCollection | Contains the scratchs for the shape inherit by the master shape. |
| InheritGroup | Group | |
| InheritUsers | UserCollection | Contains the users for the shape inherit by the master shape. |
| InheritTextXForm | TextXForm | Contains the textxform values for the shape inherit by the parent style and the master shape. |
| InheritGeoms | GeomCollection | Contains the Geoms values for the shape inherit by the master shape. |
| InheritParas | ParaCollection | Contains the paras for the shape inherit by the parent style and the master shape. |
| InheritTabs | TabsCollection | Contains the tabs for the shape inherit by the parent style and the master shape. |
| InheritTextBlock | TextBlock | Contains the textblock values for the shape inherit by the parent style and the master shape. |
| InheritLine | Line | Contains the line formatting values for the shape inherit by the parent style and the master shape. |
| InheritFill | Fill | Contains the fill formatting values for the shape inherit by the parent style and the master shape. |
| XForm1D | XForm1D | 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. |
| Event | Event | Contains elements that specify formulas that control shape events. |
| LayerMem | LayerMem | Contains the LayerMember element, which specifies each layer to which the shape is assigned. |
| Foreign | Foreign | Contains elements specifying the width and height of an object from another program used in a Microsoft Visio document. |
| TextBlock | TextBlock | Contains elements that specify the alignment, margins, and default tab stop positions of text in a shape’s text block. |
| TextXForm | TextXForm | Contains elements that specify positioning information about a shape’s text block. |
| Align | Align | Indicates the alignment of a shape with respect to the guide or guide point to which the shape is glued. The Align eleme |
| Protection | Protection | Locking helps prevent inadvertent changes to the shape but does not prevent Microsoft Visio from resetting values in oth |
| Help | Help | Contains elements specifying the Shape element’s Help file topic and copyright information. |
| Misc | Misc | Contains elements specifying the Shape element’s Help file topic and copyright information. |
| Image | Image | Contains the gamma, brightness, contrast, blur, sharpen, denoise, and transparency values for a bitmap. |
| Group | Group | Contains elements that control how you add shapes to a group, move members of a group, and select groups. |
| Layout | Layout | Contains elements that control shape placement and connector routing settings. |
| Chars | CharCollection | Contains a collection of Char elements. |
| Paras | ParaCollection | Contains a collection of Para elements. |
| Scratchs | ScratchCollection | Contains a collection of Scratch elements. |
| Connections | ConnectionCollection | Contains a collection of Connection elements. |
| ContainerProperties | ContainerProperties | Contains shape’s ContainerProperties. |
| ConnectionABCDs | ConnectionABCDCollection | Contains a collection of ConnectionABCD elements. |
| Fields | FieldCollection | Contains a collection of Field elements. |
| Controls | ControlCollection | Contains a collection of Control elements. |
| Geoms | GeomCollection | Contains a collection of Geom elements. |
| Acts | ActCollection | Contains a collection of Act elements. |
| Users | UserCollection | Contains a collection of User elements. |
| Props | PropCollection | Contains a collection of Prop elements. |
| Hyperlinks | HyperlinkCollection | Contains a collection of Hyperlink elements. |
| SmartTagDefs | SmartTagDefCollection | Contains a collection of SmartTagDef elements. |
| TabsCollection | TabsCollection | Contains a collection of Tab elements. |
| Data1 | String | Contains an arbitrary string value that is used to supply additional information about a shape. |
| Data2 | String | Contains an arbitrary string value that is used to supply additional information about a shape. |
| Data3 | String | Contains an arbitrary string value that is used to supply additional information about a shape. |
| ClippingPath | String | Contains Clipping Path string value. |
| ForeignData | ForeignData | Contains a MIME (Multipurpose Internet Mail Extensions) encoded BLOB of picture data, such as Windows metafile, bitmap, |
| MasterShape | Shape | This attribute may only be present in shapes that are members of a group shape, and the group is an instance of a master |
| Master | Master | The Master from which the shape inherits its data. |
| ParentShape | Shape | Shape’s parent. |
| RootShape | Shape | Returns the top-level shape of an instance if this shape is part of a master instance. Read-only. |
| Diagram | Diagram | Root element of Visio objects hierarchy. |
| Page | Page | Root element of Visio objects hierarchy. |
| OneD | boolean | Determines whether the shape behaves as a one-dimensional (1-D) object. Read-only. |
| TwoD | boolean | Determines whether the shape behaves as a two-dimensional (2-D) object. |
| ControlData | byte[] | Gets the data of control. |
| ActiveXControl | ActiveXControl | Gets the ActiveX control. |
| ZOrderIndex | int | Returns the index of a shape in the z-order except the guide shape. |
| PresetTheme | int | Apply a preset theme to this shape The value of the property is PresetThemeValue integer constant. |
| PresetThemeVariant | int | Apply a preset theme variant to this shape The value of the property is PresetThemeVariantValue integer constant. |
| PresetThemeQuickStyle | int | Apply a preset theme variant quickstyle to this shape The value of the property is PresetQuickStyleValue integer constan |
| ThreeDFormat | ThreeDFormat | Gets the ThreeDFormat. |
Methods
| Name | Description |
|---|---|
| convertToGroup | Converts a selection or an object from another application (a linked or embedded object) to a group. |
| getConnectorsType | Get Connectors type |
| setConnectorJumpValue | Set Jump code value and Jump style value for Connector |
| setConnectorsType | Set Connectors type |
| getRelationFlag | Returns RelationFlag that represents the relationship of one shape to another shape. |
| getRelationShapeCollection | Returns RelationShapeCollection that represents the relationshapes of one shape. |
| setPresetThemeStyleMatrics | pply a preset theme variant quickstyle to this shape, like theme styles options in shape styles dropdown list |
| copy | |
| bringForward | Brings the shape forward one position in the z-order. |
| sendBackward | Moves the shape back one position in the z-order. |
| bringToFront | Brings the shape to the front of the z-order. |
| sendToBack | Moves the shape to the back of the z-order. |
| getConnectorRule | Returns a connectorRule that contains the shape id and connecton that are connected to the shape. |
| connectedShapes | Returns an array that contains the identifiers (IDs) of the shapes that are connected to the shape. |
| isInGroup | Indicates whether this shape is in a group shape. |
| isContain | Indicates whether this shape is contain another shape. |
| isIntersect | Indicates whether this shape is intersect another shape. |
| isConnected | Indicates whether this two shapes are connected. |
| centerDrawing | Center the shape with respect to the extent of the page |
| isGlued | Indicates whether this two shapes are glued. |
| refreshData | |
| gluedShapes | Returns an array that contains the identifiers of the shapes that are glued to a shape. |
| dependsOnShapes | Returns an array that contains the identifiers of the shapes that are depends on a shape. |
| setWidth | Sets new width of shape. |
| setHeight | Sets new height of shape. |
| setAngle | Sets new angle of shape. The angle’s unit is radian. |
| moveTo | Moves shape on new absolute position on the page. |
| move | Moves shape on the dX and dY inches from current position. |
| getDisplayText | Get the text displayed on the interface |
| getPureText | Get the text string |
| ungroup | Ungroup Shape |
| replaceText | Replace the text string of a shape . |
| toPdf | Saves the shape to a pdf file. |