Shape Object

The Shape object is used for controlling and obtaining information about a shape in a ConceptDraw document. Provides access to virtually all elements and characteristics of a shape. In ConceptDraw Basic, the Shape object describes all ConceptDraw shapes except service objects - that is, 1D-shapes, simple 2D-shapes, groups, connectors, smart connectors, vector pictures, object that contain raster images, and other. Depending on the shape type to which the instance of the Shape object corresponds, the object supports different methods and properties.

Properties

Name Supported Types Description
Angle All The angle to which the given object is rotated relative to the coordinate system of the parent shape.
BeginX 1D-shape The X coordinate of the begin point of the shape.
BeginY 1D-shape The Y coordinate of the begin point of the shape.
ConnectObjBegin 1D-shape, connectors, smart-connectors

The ID of the shape, to which the begin point of this 1D-shape is connected.

ConnectObjEnd 1D-shape, connectors, smart-connectors The ID of the shape, to which the end point of this 1D-shape is connected.
ConnectTypeBegin 1D-shape, connectors, smart-connectors The connection type of the connector's begin point to the shape.
ConnectTypeEnd 1D-shape, connectors, smart-connectors The connection type of the connector's begin point to the shape.
DblClick All The shape's double-click action.
DblClickAction All The user-defined double-click action.
Desc All The description of the shape.
Document All Read-only. Returns the document, to which the shape belongs.
EndX 1D-shape The X-coordinate of the end point of the shape.
EndY 1D-shape The Y-coordinate of the end point of the shape.
FillColor 1D-shape, 2D-shape Read-only. The fill color of the shape.
FillPatColor 1D-shape, 2D-shape Read-only. The fill pattern color of the shape.
FillPattern 1D-shape, 2D-shape The type of the fill pattern of the shape.
FlipX All A flag that specifies whether the shape is flipped horizontally.
FlipY All A flag that specifies whether the shape is flipped vertically.
FlowAroundObjects Smart-connector A flag that specifies whether the smart connector should flow around other shapes, located on the same page as this smart connector (True - flow around, False - pass through).
GPinX All The X-coordinate of the rotation center of the shape in the coordinate system of the parent group.
GPinY All The X-coordinate of the rotation center of the shape in the coordinate system of the parent group.
Height All The height of the shape.
Hyperlink All The ID of the hyperlink, assigned to the shape.
ID All Read-only. ID of the shape.
Is1D All Read-only. True if 1D-shape, False if 2D-shape or other object type.
Layer All The ID of the layer to which the shape belongs.
LineBegin 1D-shape The begin arrowhead type of a 1D-shape.
LineEnd 1D-shape The end arrowhead type of a 1D-shape.
LineEndSize 1D-shape

The size of begin and end arrowheads of a 1D-shape.

LockAspect All A flag that protects the shape from unproportional resizing.
LockBegin 1D-shape A flag that protects the begin point of a 1D-shape from repositioning with the mouse.
LockCalcWH All

A flag that specifies whether to update the alignment box size if the coordinates of the shape's vertices have been changed.

LockConnector Smart-connector A flag that doesn't allow the smart connector to re-route automatically.
LockDelete All A flag that protects the shape from deleting.
LockEnd 1D-shape A flag that protects the end point of a 1D-shape from repositioning with the mouse.
LockFlipX All A flag that protects the shape from flipping horizontally.
LockFlipY All A flag that protects the shape from flipping vertically.
LockHeight All A flag that protects the shape's height when the shape is resized.
LockMoveX All A flag that protects the shape from horizontal repositioning.
LockMoveY All A flag that protects the shape from vertical repositioning.
LockRotate All A flag that protects the shape from rotation.
LockVertex All A flag that protects the vertices from modifying with the mouse.
LockWidth All A flag that protects the shape's width when the shape is resized.
LPinX All The X offset of the shape's rotation center (GPin) with respect to the center of the shape's coordinate system.
LPinY All The Y offset of the shape's rotation center (GPin) with respect to the center of the shape's coordinate system.
Name All The shape's name.
NonPrinting All A flag that specifies whether to print the shape when the document is printed: True - don't print shape, False - print shape.
ObjType All The shape type: simple shape, group, vector picture, etc.
Page All The page to which the shape belongs.
Parent All The parent group (the group to which this shape belongs).
PenColor 1D-shape, 2D-shape Read-only. The line color for this shape.
PenPattern 1D-shape, 2D-shape The line pattern for this shape.
PenWeight 1D-shape, 2D-shape The line width for this shape.
ResizeBehaviour All Specifies how the shape behaves when its parent group is being resized.
RoundCorners 1D-shape, 2D-shape The corner radius of the shape.
ShadowColor 1D-shape, 2D-shape The shape's shadow color.
ShadowPatColor 1D-shape, 2D-shape The shape's shadow pattern color.
ShadowPattern 1D-shape, 2D-shape The shape's shadow pattern type.
ShowAlignBox All A flag that sets whether to display the shape's alignment box.
ShowControlHandles All A flag that sets whether to display the shape's control handles.
ShowShapeHandles All A flag that sets whether to display the shape's resize and rotation handles.
ShowText All A flag that sets whether to display the shape's text.
SubID All Read-only. The unique number of the shape within its parent object (group or page).
Text All The string that contains the text of the shape.
TextAngle All The angle to which the object text is rotated with respect to the coordinate system of the shape.
TextBlock All The shape's text block.
TextFlipX All A flag that specifies whether the shape's text is flipped horizontally. True - text is flipped, False - text is not flipped.
TextFlipY All A flag that specifies whether the shape's text is flipped vertically. True - text is flipped, False - text is not flipped.
TextGPinX All The X-coordinate of the rotation center of the shape's text block.
TextGPinY All The Y-coordinate of the rotation center of the shape's text block.
TextHeight All The text block height.
TextLPinX All

The X offset of the rotation center of the shape's text block with respect to the center of the shape's coordinate system.

TextLPinY All

The Y offset of the rotation center of the shape's text block with respect to the center of the shape's coordinate system.

TextWidth All The text block width.
Width All The shape's height.

Methods

Name Supported Types Description
Action All

Returns a user-defined action by its index in the user-defined action collection of the shape.

ActionsNum All Returns the number of user-defined actions of the shape.
AddAction All

Adds a new user-defined action.

AddConnectDot All Adds a new connection point to the shape.
AddControlDot All Adds a new control handle to the shape.
AddCustomProp All Adds a new connection point custom property to the shape.
AddGeometry 1D-shape, 2D-shape Adds a new geometry to the geometry collection of the shape.
AddVariable All

Adds a new user variable to the variable collection of the shape.

ArcTo All Draws an arc.
BeginShape group

Creates a shape in the group which is later considered as the current Basic shape of the group, or returns the current Basic shape of the group.

Character All Returns a character block by its index in the character block collection of the shape.
CharactersNum All Returns the number of character blocks in the shape.
ColorProperty All Returns the color of the specified shape property. The property is defined by the constant tag and the indexes of the geometry and segment of the shape to which it belongs.
ConnectDot All Returns a connection point by its index in the connection point collection of the shape.
ConnectDotsNum All Returns the number of connection points in the connection point collection of the shape.
ControlDot All Returns a control handle by its index in the control handle collection of the shape.
ControlDotsNum All Returns the number of control handles in the control handle collection of the shape.
ConvertToGroup group

Converts a ConceptDraw Vector Picture object to a ConceptDraw group preserving its position in the document.

ConvertToVFPicture group

Converts a ConceptDraw shape to a Vector Picture object preserving its position in the document.

CustomProp All

Returns a custom property by its index in the custom property collection of the shape.

CustomPropsNum All Returns the number of custom properties of the shape.
DrawConnector group Draws a connector.
DrawGroup group Creates a group inside the given group.
DrawGuide group Draws a guide line.
DrawLine All Draws a line.
DrawOval All Draws an ellipse.
DrawRect All Draws a rectangle.
DrawSector All Draws a sector of the circle.
DrawSmartConnector group Draws a smart connector.
DrawStamp group

Draws inside the group a copy of the specified shape with the specified size and position, same as the Stamp tool in ConceptDraw.

DrawStampSelection group

Draws inside the group copies of all selected shapes with the specified size and position, same as the Stamp tool in ConceptDraw.

DropStamp group

Creates inside the group a copy of the specified shape, same as the Stamp tool in ConceptDraw, preserving the size of the original shape.

DropStampSelection group

Creates inside the group copies of all selected shapes, same as the Stamp tool in ConceptDraw, preserving the size of the original shapes.

EndShape group

Returns the current Basic shape of the group and informs ConceptDraw that creation of the shape is finished.

Equal All Copies all the properties and the contents of the specified shape to the given shape.
GeometriesNum 1D-shape, 2D-shape Returns the number of geometries in the shape.
Geometry 1D-shape, 2D-shape Returns a geometry by its index in the geometry collection of the shape.
GetBooleanProperty All Returns the value of a Boolean type property.
GetByteProperty All Returns the value of a Byte type property.
GetCharacterIndex All

Returns the index of the character block which includes the character with the specified index in the line of the shape's text.

GetDoubleProperty All Returns the value of a Double type property.
GetIntegerProperty All Returns the value of an Integer type property.
GetLongProperty All Returns the value of a Long type property.
GetParagraphIndex All

Returns the index of the paragraph in the shape's paragraph collection by the specified character's index in the shape's text.

GetPropertyFormula All Returns the property's formula in the form of a string.
GetSingleProperty All Returns the value of a Single type property.
GetStringProperty All Returns the value of a String type property
InsertPicture group Inserts into a group an object that contains picture from the specified file.
IsDefaultFormula All Returns True if the specified property of the shape has a formula that is marked as default. Otherwise returns False.
IsNullFormula All

Returns True if the specified property of the shape has no formula. Otherwise returns False.

LAtoWA All

Converts the specified angle from local coordinates of this shape into global coordinates.

LineTo 1D-shape, 2D-shape, group Draws a line in the shape.
LPtoGP All

Converts the coordinates of the point from local coordinates of this shape into the coordinate system of the parent shape (group or page).

LPtoWP All

Converts the coordinates of the point from local coordinate system of this shape into global coordinates.

MoveTo 1D-shape, 2D-shape, group Sets the position of the current point of the shape, used for drawing shapes.
Paragraph All Returns a paragraph by its index in the paragraph collection of the shape.
ParagraphsNum All Returns the number of paragraphs in the shape's text.
PropertyChanged All

Tells the ConceptDraw engine that the value of the specified table property has been changed and the formulas of the dependent properties must be re-calculated.

RecalcProperty All

Tells the ConceptDraw engine that the value of the specified table property is to be re-calculated using its table formula.

RemoveAction All Removes a user-defined action by its index in the user-defined action collection of the shape.
RemoveCharacter All Removes a character block by its index in the character block collection of the shape.
RemoveConnectDot All Removes a connection point by its index in the connection point collection of the shape.
RemoveControlDot All Removes a control handle by its index in the control handle collection of the shape.
RemoveCustomProp All

Removes a user-defined action by its index in the user-defined action collection of the shape.

RemoveGeometry 1D-shape, 2D-shape Removes a geometry by its index in the geometry collection of the shape.
RemoveParagraph All Removes a paragraph by its index in the paragraph collection of the shape.
RemoveServObj group

Removes a service object by its index in the service object collection of the group.

RemoveServObjByID group

Removes a service object with the specified ID (the ID property) from the service object collection of the group.

RemoveShape group

Removes a shape by its index in the shape collection of the group.

RemoveShapeByID group

Removes a shape with the specified ID from the shape collection of the group.

RemoveVariable All

Removes a user-defined variable by its index in the user-defined variable collection of the shape.

ReorderServObj group

Moves the service object to the specified position in the service object collection of the group.

ReorderServObjByID group

Moves a service object with the specified ID to the indicated position in the service object collection of the group.

ReorderShape group

Moves the shape to the specified position in the shape collection of the group.

ReorderShapeByID group

Moves a shape with the specified ID to the indicated position in the shape collection of the group.

ServObj group Returns a service object by its index in the service object collection of the group.
ServObjByID group

Searches for a service object with the specified ID in the service object collection of the group.

ServObjsNum group Returns the number of service objects in the group.
SetBooleanProperty All

Sets the value of a Boolean type property by the specified tag.

SetByteProperty All Sets the value of a Byte type property by the specified tag.
SetCharColor All

Sets color for the specified character block of the shape's text.

SetCharFont All Sets font for the specified character block of the shape's text.
SetCharHyperlink All

Sets hyperlink for the specified character block of the shape's text.

SetCharLanguage All Sets encoding for the specified character block of the shape's text.
SetCharPos All

Sets position (subscript, superscript) for the specified character block of the shape's text.

SetCharSize All Sets font size for the specified character block of the shape's text.
SetCharSpacing All Sets character spacing for the specified character block of the shape's text.
SetCharStyle All

Sets font style (bold, italic, underline, etc.) for the specified character block of the shape's text.

SetDefaultFormula All Creates a default formula for the specified table property of the shape.
SetDoubleProperty All Sets a value of the specified Double type table property.
SetIntegerProperty All Sets a value of the specified Integer type table property.
SetLongProperty All Sets a value of the specified Long type table property.
SetNullFormula All Removes the formula from the specified table property of the shape.
SetParaAfterSpacing All

Sets spacing between the specified and next paragraph of the shape's text.

SetParaBeforeSpacing All Sets spacing between the specified and previous paragraph of the shape's text.
SetParaFirstInd All

Sets the first line indent for the specified paragraph of the shape.

SetParaHAlign All

Sets horizontal alignment type for the specified paragraph relative to the text box.

SetParaLeftInd All

Sets the distance to the left edge of the text box for the specified paragraph of the shape.

SetParaLineSpacing All

Sets the line spacing for the specified paragraph of the shape.

SetParaRightInd All Sets the distance to the right edge of the text box for the specified paragraph of the shape.
SetPropertyFormula All Sets a table formula for the specified table property of the shape.
SetSingleProperty All Sets a value of the specified Single type table property.
SetStringProperty All Sets a value of the specified String type table property.
SetStyle All Assigns a style with the specified name to the shape.
Shape group Returns a shape by its index in the shape collection of the group.
ShapeByID group Searches for a shape with the specified ID in the shape collection of the group.
ShapesNum group Returns the number of shapes in the group.
SplineStart 1D-shape, 2D-shape, group Starts drawing a new spline.
SplineTo 1D-shape, 2D-shape, group Creates a spline segment in the shape.
Variable All

Returns a user-defined variable by its index in the user-defined variable collection of the shape.

VariablesNum All Returns the number of user-defined variables contained in the shape.
WPtoLP All

Converts the coordinates of the specified point from the global coordinate system to the local coordinate system of this shape.

Remarks

A ConceptDraw shape can be located on a document page, inside a group of shapes, or be stored inside a library object (Master object) - that is, inside a library. Which page or group contains its own collection of ConceptDraw shapes, and uses the appropriate methods of the Page and Shape objects to control them. Each library object can contain only one ConceptDraw shape. An instance of the Shape object can also be retrieved by using properties of other objects (Shape, ServObj, Window) which refer to the shape to which they belong.

The Shape object has some properties, known as table properties of the shape - that is, the properties which can be associated with a table formula. To work with such properties as with table properties the appropriate methods of the Shape object are used (see above). Note, that if a table property was modified, one should use the RecalcProperty and PropertyChanged methods to re-calculate the depending properties and re-draw the shape respectively.

Also the methods of the Shape object provide control over connection points of connectors, control handles, user-defined actions, variables, custom properties, text block parameters, paragraphs and character blocks of the shape's text, shape geometries, etc.

An instance of the Shape object can be retrieved by using the following methods and properties:
Master object: Shape property.
Page and Shape object: Shape method, ShapeByID method and other
ServObj and Shape object: Parent property.
Window object: Shape property.

Also an instance of the Shape object can be retrieved by using the thisShape global variable, pre-defined at the shape script level. thisShape returns the shape which script is being executed when the variable is referred to.

 

See Also

Character object, Color object, Document object, Hyperlink object, Master object, Page object, Paragraph object, ServObj object, TextBlock object, Window object