Shape

Shape class

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

Constructors

NameDescription
ShapeConstructor.

Properties

NameTypeDescription
IDlongThe unique ID of the element within its parent element.
DelintA flag indicating whether the element is deleted locally. A value of 1 indicates that the element is deleted locally. Th
UniqueIDUUIDA GUID (globally unique identifier) assigned to the shape.
NameStringThe name of the element.
NameUStringThe universal name of the element.
TypeintThe type of a shape. It may be one of the following values: Group, Shape, Guide, or Foreign. The value of the property i
LineStyleStyleSheetStyleSheet from which this shape inherits line formatting
FillStyleStyleSheetStyleSheet from which this shape inherits fill formatting.
TextStyleStyleSheetStyleSheet from which this shape inherits text formatting.
ShapesShapeCollectionContains a collection of Shape elements.
TextTextContains the text of a shape.
XFormXFormContains elements specifying general positioning information about a shape.
LineLineContains elements that control line attributes for a shape, such as pattern, weight, and color. These elements determine
FillFillContains the current fill formatting values for the shape and the shape’s drop shadow, including pattern, foreground col
HasThemeColorbooleanGets whether the shape has theme color.
InheritCharsCharCollectionContains the char values for the shape inherit by the master shape.
InheritPropsPropCollectionContains the props for the shape inherit by the master shape.
InheritFieldsFieldCollectionContains the fields for the shape inherit by the master shape.
InheritActsActCollectionContains the actions for the shape inherit by the master shape.
InheritHyperlinksHyperlinkCollectionContains the Hyperlinks for the shape inherit by the master shape.
InheritXFormXForm
InheritXForm1DXForm1D
InheritMiscMiscContains the Misc for the shape inherit by the master shape.
InheritProtectionProtectionContains the Protection for the shape inherit by the master shape.
InheritEventEventContains the Event for the shape inherit by the master shape.
InheritLayerMemLayerMemContains the LayerMem for the shape inherit by the master shape.
InheritHelpHelpContains the Help for the shape inherit by the master shape.
InheritLayoutLayoutContains the Layout for the shape inherit by the master shape.
InheritControlsControlCollectionContains the controls for the shape inherit by the master shape.
InheritConnectionsConnectionCollectionContains the connections for the shape inherit by the master shape.
InheritScratchsScratchCollectionContains the scratchs for the shape inherit by the master shape.
InheritGroupGroup
InheritUsersUserCollectionContains the users for the shape inherit by the master shape.
InheritTextXFormTextXFormContains the textxform values for the shape inherit by the parent style and the master shape.
InheritGeomsGeomCollectionContains the Geoms values for the shape inherit by the master shape.
InheritParasParaCollectionContains the paras for the shape inherit by the parent style and the master shape.
InheritTabsTabsCollectionContains the tabs for the shape inherit by the parent style and the master shape.
InheritTextBlockTextBlockContains the textblock values for the shape inherit by the parent style and the master shape.
InheritLineLineContains the line formatting values for the shape inherit by the parent style and the master shape.
InheritFillFillContains the fill formatting values for the shape inherit by the parent style and the master shape.
XForm1DXForm1DContains x- and y-coordinates of the begin point and end point of a 1-D shape. This element appears for 1-D shapes only.
EventEventContains elements that specify formulas that control shape events.
LayerMemLayerMemContains the LayerMember element, which specifies each layer to which the shape is assigned.
ForeignForeignContains elements specifying the width and height of an object from another program used in a Microsoft Visio document.
TextBlockTextBlockContains elements that specify the alignment, margins, and default tab stop positions of text in a shape’s text block.
TextXFormTextXFormContains elements that specify positioning information about a shape’s text block.
AlignAlignIndicates the alignment of a shape with respect to the guide or guide point to which the shape is glued. The Align eleme
ProtectionProtectionLocking helps prevent inadvertent changes to the shape but does not prevent Microsoft Visio from resetting values in oth
HelpHelpContains elements specifying the Shape element’s Help file topic and copyright information.
MiscMiscContains elements specifying the Shape element’s Help file topic and copyright information.
ImageImageContains the gamma, brightness, contrast, blur, sharpen, denoise, and transparency values for a bitmap.
GroupGroupContains elements that control how you add shapes to a group, move members of a group, and select groups.
LayoutLayoutContains elements that control shape placement and connector routing settings.
CharsCharCollectionContains a collection of Char elements.
ParasParaCollectionContains a collection of Para elements.
ScratchsScratchCollectionContains a collection of Scratch elements.
ConnectionsConnectionCollectionContains a collection of Connection elements.
ContainerPropertiesContainerPropertiesContains shape’s ContainerProperties.
ConnectionABCDsConnectionABCDCollectionContains a collection of ConnectionABCD elements.
FieldsFieldCollectionContains a collection of Field elements.
ControlsControlCollectionContains a collection of Control elements.
GeomsGeomCollectionContains a collection of Geom elements.
ActsActCollectionContains a collection of Act elements.
UsersUserCollectionContains a collection of User elements.
PropsPropCollectionContains a collection of Prop elements.
HyperlinksHyperlinkCollectionContains a collection of Hyperlink elements.
SmartTagDefsSmartTagDefCollectionContains a collection of SmartTagDef elements.
TabsCollectionTabsCollectionContains a collection of Tab elements.
Data1StringContains an arbitrary string value that is used to supply additional information about a shape.
Data2StringContains an arbitrary string value that is used to supply additional information about a shape.
Data3StringContains an arbitrary string value that is used to supply additional information about a shape.
ClippingPathStringContains Clipping Path string value.
ForeignDataForeignDataContains a MIME (Multipurpose Internet Mail Extensions) encoded BLOB of picture data, such as Windows metafile, bitmap,
MasterShapeShapeThis attribute may only be present in shapes that are members of a group shape, and the group is an instance of a master
MasterMasterThe Master from which the shape inherits its data.
ParentShapeShapeShape’s parent.
RootShapeShapeReturns the top-level shape of an instance if this shape is part of a master instance. Read-only.
DiagramDiagramRoot element of Visio objects hierarchy.
PagePageRoot element of Visio objects hierarchy.
OneDbooleanDetermines whether the shape behaves as a one-dimensional (1-D) object. Read-only.
TwoDbooleanDetermines whether the shape behaves as a two-dimensional (2-D) object.
ControlDatabyte[]Gets the data of control.
ActiveXControlActiveXControlGets the ActiveX control.
ZOrderIndexintReturns the index of a shape in the z-order except the guide shape.
PresetThemeintApply a preset theme to this shape The value of the property is PresetThemeValue integer constant.
PresetThemeVariantintApply a preset theme variant to this shape The value of the property is PresetThemeVariantValue integer constant.
PresetThemeQuickStyleintApply a preset theme variant quickstyle to this shape The value of the property is PresetQuickStyleValue integer constan
ThreeDFormatThreeDFormatGets the ThreeDFormat.

Methods

NameDescription
convertToGroupConverts a selection or an object from another application (a linked or embedded object) to a group.
getConnectorsTypeGet Connectors type
setConnectorJumpValueSet Jump code value and Jump style value for Connector
setConnectorsTypeSet Connectors type
getRelationFlagReturns RelationFlag that represents the relationship of one shape to another shape.
getRelationShapeCollectionReturns RelationShapeCollection that represents the relationshapes of one shape.
setPresetThemeStyleMatricspply a preset theme variant quickstyle to this shape, like theme styles options in shape styles dropdown list
copy
bringForwardBrings the shape forward one position in the z-order.
sendBackwardMoves the shape back one position in the z-order.
bringToFrontBrings the shape to the front of the z-order.
sendToBackMoves the shape to the back of the z-order.
getConnectorRuleReturns a connectorRule that contains the shape id and connecton that are connected to the shape.
connectedShapesReturns an array that contains the identifiers (IDs) of the shapes that are connected to the shape.
isInGroupIndicates whether this shape is in a group shape.
isContainIndicates whether this shape is contain another shape.
isIntersectIndicates whether this shape is intersect another shape.
isConnectedIndicates whether this two shapes are connected.
centerDrawingCenter the shape with respect to the extent of the page
isGluedIndicates whether this two shapes are glued.
refreshData
gluedShapesReturns an array that contains the identifiers of the shapes that are glued to a shape.
dependsOnShapesReturns an array that contains the identifiers of the shapes that are depends on a shape.
setWidthSets new width of shape.
setHeightSets new height of shape.
setAngleSets new angle of shape. The angle’s unit is radian.
moveToMoves shape on new absolute position on the page.
moveMoves shape on the dX and dY inches from current position.
getDisplayTextGet the text displayed on the interface
getPureTextGet the text string
ungroupUngroup Shape
replaceTextReplace the text string of a shape .
toPdfSaves the shape to a pdf file.

Shape()

Constructor.

Shape.ID property

The unique ID of the element within its parent element.

Type: long

Shape.Del property

A flag indicating whether the element is deleted locally. A value of 1 indicates that the element is deleted locally. The value of the property is BOOL integer constant.

Type: int

Shape.UniqueID property

A GUID (globally unique identifier) assigned to the shape.

Type: UUID

Shape.Name property

The name of the element.

Type: String

Shape.NameU property

The universal name of the element.

Type: String

Shape.Type property

The type of a shape. It may be one of the following values: Group, Shape, Guide, or Foreign. The value of the property is TypeValue integer constant.

Type: int

Shape.LineStyle property

StyleSheet from which this shape inherits line formatting

Type: StyleSheet

Shape.FillStyle property

StyleSheet from which this shape inherits fill formatting.

Type: StyleSheet

Shape.TextStyle property

StyleSheet from which this shape inherits text formatting.

Type: StyleSheet

Shape.Shapes property

Contains a collection of Shape elements.

Type: ShapeCollection

Shape.Text property

Contains the text of a shape.

Type: Text

Shape.XForm property

Contains elements specifying general positioning information about a shape.

Type: XForm

Shape.Line property

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).

Type: Line

Shape.Fill property

Contains the current fill formatting values for the shape and the shape’s drop shadow, including pattern, foreground color, and background color.

Type: Fill

Shape.HasThemeColor property

Gets whether the shape has theme color.

Type: boolean

Shape.InheritChars property

Contains the char values for the shape inherit by the master shape.

Type: CharCollection

Shape.InheritProps property

Contains the props for the shape inherit by the master shape.

Type: PropCollection

Shape.InheritFields property

Contains the fields for the shape inherit by the master shape.

Type: FieldCollection

Shape.InheritActs property

Contains the actions for the shape inherit by the master shape.

Type: ActCollection

Contains the Hyperlinks for the shape inherit by the master shape.

Type: HyperlinkCollection

Shape.InheritXForm property

Type: XForm

Shape.InheritXForm1D property

Type: XForm1D

Shape.InheritMisc property

Contains the Misc for the shape inherit by the master shape.

Type: Misc

Shape.InheritProtection property

Contains the Protection for the shape inherit by the master shape.

Type: Protection

Shape.InheritEvent property

Contains the Event for the shape inherit by the master shape.

Type: Event

Shape.InheritLayerMem property

Contains the LayerMem for the shape inherit by the master shape.

Type: LayerMem

Shape.InheritHelp property

Contains the Help for the shape inherit by the master shape.

Type: Help

Shape.InheritLayout property

Contains the Layout for the shape inherit by the master shape.

Type: Layout

Shape.InheritControls property

Contains the controls for the shape inherit by the master shape.

Type: ControlCollection

Shape.InheritConnections property

Contains the connections for the shape inherit by the master shape.

Type: ConnectionCollection

Shape.InheritScratchs property

Contains the scratchs for the shape inherit by the master shape.

Type: ScratchCollection

Shape.InheritGroup property

Type: Group

Shape.InheritUsers property

Contains the users for the shape inherit by the master shape.

Type: UserCollection

Shape.InheritTextXForm property

Contains the textxform values for the shape inherit by the parent style and the master shape.

Type: TextXForm

Shape.InheritGeoms property

Contains the Geoms values for the shape inherit by the master shape.

Type: GeomCollection

Shape.InheritParas property

Contains the paras for the shape inherit by the parent style and the master shape.

Type: ParaCollection

Shape.InheritTabs property

Contains the tabs for the shape inherit by the parent style and the master shape.

Type: TabsCollection

Shape.InheritTextBlock property

Contains the textblock values for the shape inherit by the parent style and the master shape.

Type: TextBlock

Shape.InheritLine property

Contains the line formatting values for the shape inherit by the parent style and the master shape.

Type: Line

Shape.InheritFill property

Contains the fill formatting values for the shape inherit by the parent style and the master shape.

Type: Fill

Shape.XForm1D property

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.

Type: XForm1D

Shape.Event property

Contains elements that specify formulas that control shape events.

Type: Event

Shape.LayerMem property

Contains the LayerMember element, which specifies each layer to which the shape is assigned.

Type: LayerMem

Shape.Foreign property

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.

Type: Foreign

Shape.TextBlock property

Contains elements that specify the alignment, margins, and default tab stop positions of text in a shape’s text block.

Type: TextBlock

Shape.TextXForm property

Contains elements that specify positioning information about a shape’s text block.

Type: TextXForm

Shape.Align property

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.

Type: Align

Shape.Protection property

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.

Type: Protection

Shape.Help property

Contains elements specifying the Shape element’s Help file topic and copyright information.

Type: Help

Shape.Misc property

Contains elements specifying the Shape element’s Help file topic and copyright information.

Type: Misc

Shape.Image property

Contains the gamma, brightness, contrast, blur, sharpen, denoise, and transparency values for a bitmap.

Type: Image

Shape.Group property

Contains elements that control how you add shapes to a group, move members of a group, and select groups.

Type: Group

Shape.Layout property

Contains elements that control shape placement and connector routing settings.

Type: Layout

Shape.Chars property

Contains a collection of Char elements.

Type: CharCollection

Shape.Paras property

Contains a collection of Para elements.

Type: ParaCollection

Shape.Scratchs property

Contains a collection of Scratch elements.

Type: ScratchCollection

Shape.Connections property

Contains a collection of Connection elements.

Type: ConnectionCollection

Shape.ContainerProperties property

Contains shape’s ContainerProperties.

Type: ContainerProperties

Shape.ConnectionABCDs property

Contains a collection of ConnectionABCD elements.

Type: ConnectionABCDCollection

Shape.Fields property

Contains a collection of Field elements.

Type: FieldCollection

Shape.Controls property

Contains a collection of Control elements.

Type: ControlCollection

Shape.Geoms property

Contains a collection of Geom elements.

Type: GeomCollection

Shape.Acts property

Contains a collection of Act elements.

Type: ActCollection

Shape.Users property

Contains a collection of User elements.

Type: UserCollection

Shape.Props property

Contains a collection of Prop elements.

Type: PropCollection

Contains a collection of Hyperlink elements.

Type: HyperlinkCollection

Shape.SmartTagDefs property

Contains a collection of SmartTagDef elements.

Type: SmartTagDefCollection

Shape.TabsCollection property

Contains a collection of Tab elements.

Type: TabsCollection

Shape.Data1 property

Contains an arbitrary string value that is used to supply additional information about a shape.

Type: String

Shape.Data2 property

Contains an arbitrary string value that is used to supply additional information about a shape.

Type: String

Shape.Data3 property

Contains an arbitrary string value that is used to supply additional information about a shape.

Type: String

Shape.ClippingPath property

Contains Clipping Path string value.

Type: String

Shape.ForeignData property

Contains a MIME (Multipurpose Internet Mail Extensions) encoded BLOB of picture data, such as Windows metafile, bitmap, or OLE data.

Type: ForeignData

Shape.MasterShape property

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.

Type: Shape

Shape.Master property

The Master from which the shape inherits its data.

Type: Master

Shape.ParentShape property

Shape’s parent.

Type: Shape

Shape.RootShape property

Returns the top-level shape of an instance if this shape is part of a master instance. Read-only.

Type: Shape

Shape.Diagram property

Root element of Visio objects hierarchy.

Type: Diagram

Shape.Page property

Root element of Visio objects hierarchy.

Type: Page

Shape.OneD property

Determines whether the shape behaves as a one-dimensional (1-D) object. Read-only.

Type: boolean

Shape.TwoD property

Determines whether the shape behaves as a two-dimensional (2-D) object.

Type: boolean

Shape.ControlData property

Gets the data of control.

Type: byte[]

Shape.ActiveXControl property

Gets the ActiveX control.

Type: ActiveXControl

Shape.ZOrderIndex property

Returns the index of a shape in the z-order except the guide shape.

Type: int

Shape.PresetTheme property

Apply a preset theme to this shape The value of the property is PresetThemeValue integer constant.

Type: int

Shape.PresetThemeVariant property

Apply a preset theme variant to this shape The value of the property is PresetThemeVariantValue integer constant.

Type: int

Shape.PresetThemeQuickStyle property

Apply a preset theme variant quickstyle to this shape The value of the property is PresetQuickStyleValue integer constant.

Type: int

Shape.ThreeDFormat property

Gets the ThreeDFormat.

Type: ThreeDFormat

convertToGroup()

Converts a selection or an object from another application (a linked or embedded object) to a group.

getConnectorsType()

Get Connectors type

setConnectorJumpValue(code, style)

Set Jump code value and Jump style value for Connector

ParameterTypeDescription
codeintA ConLineJumpCodeValue value. Jump Code Value
styleintA ConLineJumpStyleValue value. Jump Code Style

setConnectorsType(type)

Set Connectors type

ParameterTypeDescription
typeintA ConnectorsTypeValue value. Connectors type value

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("RetrieveShapeInfo.vsd");

// get a dynamic connector type shape by id
shape = diagram.getPages().getPage("Page-2").getShapes().getShape(3);

// set dynamic connector appearance
shape.setConnectorsType(aspose.diagram.ConnectorsTypeValue.STRAIGHT_LINES);

diagram.save("out-SetConnectorAppearance.vsdx", aspose.diagram.SaveFileFormat.VSDX);

getRelationFlag(shape)

Returns RelationFlag that represents the relationship of one shape to another shape.

ParameterTypeDescription
shapeShapeShape

getRelationShapeCollection()

Returns RelationShapeCollection that represents the relationshapes of one shape.

setPresetThemeStyleMatrics(styleIndex, colorIndex)

pply a preset theme variant quickstyle to this shape, like theme styles options in shape styles dropdown list

ParameterTypeDescription
styleIndexintA PresetStyleMatricsValue value. the row of style matrics
colorIndexintA PresetColorMatricsValue value. the column of style matrics

copy(source)

ParameterTypeDescription
sourceShapeSource shape

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.

Returns: ConnectorRule.

connectedShapes(flag, categoryFilter)

Returns an array that contains the identifiers (IDs) of the shapes that are connected to the shape.

ParameterTypeDescription
flagintA ConnectedShapesFlags value. Filters the array of returned shape IDs by the directionality of the connectors. See Remarks for possible values ConnectedShapesFlags .
categoryFilterStringFilters the array of returned shape IDs by limiting it to the IDs of shapes that match the specified category java.lang.String .

Returns: IDs array long .

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("AddingNewShape.vsdx");

// get shape by id
shape = diagram.getPages().getPage("Page-3").getShapes().getShape(16);
// get connected shapes
connectedShapeIds = shape.connectedShapes(aspose.diagram.ConnectedShapesFlags.CONNECTED_SHAPES_ALL_NODES, null);

for (let i = 0; i < connectedShapeIds.length; i++) {
    shape = diagram.getPages().getPage("Page-3").getShapes().getShape(connectedShapeIds[i]);
    console.log("ID: " + shape.getID() + "\t\t Name: " + shape.getName());
}

isInGroup()

Indicates whether this shape is in a group shape.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("AddingNewShape.vsdx");

// get a sub-shape by page name, group shape ID, and then sub-shape ID
shape = diagram.getPages().getPage("Page-3").getShapes().getShape(13).getShapes().getShape(2);
console.log("Is it in a Group: " + shape.isInGroup());

isContain(shape)

Indicates whether this shape is contain another shape.

isIntersect(shape)

Indicates whether this shape is intersect another shape.

isConnected(shape)

Indicates whether this two shapes are connected.

ParameterTypeDescription
shapeShapeshape

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("RetrieveShapeInfo.vsd");

// get Visio page by name
page = diagram.getPages().getPage("Page-2");

// get Visio shapes by ids
ShapedOne = page.getShapes().getShape(1);
ShapedTwo = page.getShapes().getShape(2);

// determine whether shapes are connected
connected = ShapedOne.isConnected(ShapedTwo);
console.log("Shapes are connected: " + connected);

// determine whether shapes are glued
glued = ShapedOne.isGlued(ShapedTwo);
console.log("Shapes are Glued: " + glued);

centerDrawing()

Center the shape with respect to the extent of the page

isGlued(shape)

Indicates whether this two shapes are glued.

ParameterTypeDescription
shapeShapeshape

refreshData() (1 of 2)


refreshData(options) (2 of 2)

Refreshes shape’s position including xform ,connection and geom when changing shape’s text or other’s .

We will gather shape’s data such as shape’s text then calculate shape’s position. This method is only used to refresh shape’s data .

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("AddingNewShape.vsdx");

// get page by name
page = diagram.getPages().getPage("Page-2");

// Add master with stencil file path and master id
masterName = "Rectangle";
// Add master with stencil file path and master name
diagram.addMaster("BasicShapes.vss", masterName);

// page indexing starts from 0
PageIndex = 1;
width = 2, height = 2, pinX = 4.25, pinY = 4.5;
// Add a new rectangle shape
rectangleId = diagram.addShape(pinX, pinY, width, height, masterName, PageIndex);

// set shape properties
rectangle = page.getShapes().getShape(rectangleId);
rectangle.getXForm().getPinX().setValue(5);
rectangle.getXForm().getPinY().setValue(5);
rectangle.setType(aspose.diagram.TypeValue.SHAPE);
rectangle.getText().getValue().add(new aspose.diagram.Txt("Aspose Diagram"));
rectangle.setTextStyle(diagram.getStyleSheets().get(3));
rectangle.getLine().getLineColor().setValue("#ff0000");
rectangle.getLine().getLineWeight().setValue(0.03);
rectangle.getLine().getRounding().setValue(0.1);
rectangle.getFill().getFillBkgnd().setValue("#ff00ff");
rectangle.getFill().getFillForegnd().setValue("#ebf8df");

rectangle.refreshData();

diagram.save("out-AddShape.vsdx", aspose.diagram.SaveFileFormat.VSDX);

gluedShapes(flag, categoryFilter, otherShape)

Returns an array that contains the identifiers of the shapes that are glued to a shape.

ParameterTypeDescription
flagintA GluedShapesFlags value. The dimensionality and directionality of the connection points of the shapes to return.See Remarks for possible values GluedShapesFlags .
categoryFilterStringFilters the array of returned shape IDs by limiting it to the IDs of shapes that match the specified category java.lang.String .
otherShapeShapeOptional: additional shape to which returned shapes must also be glued, can be Shape or null.

Returns: IDs array long .

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("RetrieveShapeInfo.vsd");

// get shape by an ID
shape = diagram.getPages().getPage("Page-2").getShapes().getShape(1);
// get all glued 1D shapes
gluedShapeIds = shape.gluedShapes(aspose.diagram.GluedShapesFlags.GLUED_SHAPES_ALL_1_D, null, null);

// display shape ID and name
for (let i = 0; i < gluedShapeIds.length; i++) {
    shape = diagram.getPages().get(0).getShapes().getShape(gluedShapeIds[i]);
    console.log("ID: " + shape.getID() + "\t\t Name: " + shape.getName());
}

dependsOnShapes()

Returns an array that contains the identifiers of the shapes that are depends on a shape.

Returns: IDs array long .

setWidth(width)

Sets new width of shape.

ParameterTypeDescription
widthfloatNew width double .

setHeight(height)

Sets new height of shape.

ParameterTypeDescription
heightfloatNew height double .

setAngle(angle)

Sets new angle of shape. The angle’s unit is radian.

ParameterTypeDescription
anglefloatNew angle which unit is radian not degree double .

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("RetrieveShapeInfo.vsd");

shape = diagram.getPages().getPage("Page-2").getShapes().getShape(2);

// Add a shape and set the angle
shape.setAngle(190);

diagram.save("out-RotateVisioShape.vsdx", aspose.diagram.SaveFileFormat.VSDX);

moveTo(newPinX, newPinY)

Moves shape on new absolute position on the page.

ParameterTypeDescription
newPinXfloatNew x-coordinate of the shape’s pin (center of rotation) in relation to the origin of its parent. double .
newPinYfloatNew y-coordinate of the shape’s pin (center of rotation) in relation to the origin of its parent. double .

move(dX, dY)

Moves shape on the dX and dY inches from current position.

ParameterTypeDescription
dXfloatX offset double .
dYfloatY offset double .

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("GroupShapes.vsdx");

// get page by name
page = diagram.getPages().getPage("Page-3");
// get shape by id
shape = page.getShapes().getShape(16);
// move shape from its position, it adds values in coordinates
shape.move(1, 1);

diagram.save("out-MoveVisioShape.vsdx", aspose.diagram.SaveFileFormat.VSDX);

getDisplayText()

Get the text displayed on the interface

getPureText()

Get the text string

ungroup()

Ungroup Shape

replaceText(text, replaceText)

Replace the text string of a shape .

toPdf(fileName)

Saves the shape to a pdf file.

ParameterTypeDescription
fileNameStringthe pdf file name with full path