Previous Document Next Document

Understanding the CorelDRAW object model : Working with shapes


Working with shapes

Every document is made up of shapes, or Shape objects, which are created by using the drawing tools. Any changes that are made to the properties of a shape — such as by moving the shape, changing its size, or giving it a new fill — are immediately visible to the object model.

The shapes on a document page are stored on layers. Each shape is a member of the Layer.Shapes collection for the layer on which it appears. The shapes in a Layer.Shapes collection appear in the order in which they appear on that layer — the first shape is the one at the top of the “stack,” and the last shape is the one at the bottom. If shapes are added, reordered, or deleted, the affected Layer.Shapes collection is immediately updated to reflect the new shape order of that layer.

 
In addition, each document page has a Shapes collection, which contains all Layer.Shapes collections for that page. The first shape in a Page.Shapes collection is the one at the very top of that page, and the last shape is the one at the very bottom.

CorelDRAW provides a number of properties, methods, and events for working with shapes, the most useful of which are listed in the following table.

Class
Member
Description
AddinHook
ShapeCreated event
Is triggered when a shape is created
For more information, see Creating shapes.
Application
CreateCurve method
Creates a line or a curve “in memory”
For more information, see Creating lines and curves.
Application
SelectionChange event
Is triggered when a selection is deactivated
For more information, see Deselecting shapes.
Application
SymbolLibraries property
Contains the collection of all external symbol libraries for the application
For more information, see Creating symbols.
Color
CopyAssign method
Copies a color from one shape fill or shape outline to another
For more information, see Working with color.
Color
Type method
Specifies the color model for a shape color
For more information, see Working with color.
Curve
CreateSubPath method
Adds a subpath to a line or a curve
For more information, see Creating lines and curves.
Document
ClearSelection method
Deselects all objects in a document
For more information, see Deselecting shapes.
Document
Selection method
Returns, as a single Shape object, all selected objects in a document
For more information, see Accessing selections directly.
Document
SelectionChange event
Is triggered when a selection is deactivated
For more information, see Deselecting shapes.
Document
SelectionRange property
Returns, as a ShapeRange object, all selected objects in a document
For more information, see Accessing copies of selections.
Document
ShapeChange event
Is triggered when a shape is deselected
For more information, see Deselecting shapes.
Document
ShapeCreate event
Is triggered when a shape is created
For more information, see Creating shapes.
Document
ShapeDelete event
Is triggered when a shape is deleted
For more information, see Deleting shapes.
Document
ShapeDistort event
Is triggered when a shape is distorted
For more information, see Applying distortions.
Document
ShapeMove event
Is triggered when a shape is positioned
For more information, see Positioning shapes.
Document
ShapeTransform event
Is triggered when a shape is transformed
For more information, see Transforming shapes.
Document
SymbolLibrary property
Returns the internal symbol library for a document
For more information, see Creating symbols.
Fill
ApplyFountainFill method
Applies a fountain fill to a shape
For more information, see Applying fountain fills.
Fill
ApplyHatchFill method
Applies a hatch fill to a shape
For more information, see Applying hatch fills.
Fill
ApplyPatternFill method
Applies a pattern fill to a shape
For more information, see Applying pattern fills.
Fill
ApplyPostScriptFill method
Applies a PostScript fill to a shape
For more information, see Applying PostScript fills.
Fill
ApplyTextureFill method
Applies a texture fill to a shape
For more information, see Applying texture fills.
Fill
ApplyUniformFill method
Applies a uniform fill to a shape
For more information, see Applying uniform fills.
Fill
Fountain property
Specifies the fountain-fill properties for a shape
For more information, see Applying fountain fills.
Fill
Hatch property
Specifies the hatch-fill properties for a shape
For more information, see Applying hatch fills.
Fill
Pattern property
Specifies the pattern-fill properties for a shape
For more information, see Applying pattern fills.
Fill
PostScriptFill property
Specifies the PostScript-fill properties for a shape
For more information, see Applying PostScript fills.
Fill
Texture property
Specifies the texture-fill properties for a shape
For more information, see Applying texture fills.
Fill
Type property
Specifies the type of fill that is applied to a shape
For more information, see Coloring shapes.
Fill
UniformColor property
Specifies the uniform-fill properties for a shape
For more information, see Applying uniform fills.
FountainColor
Move method
Moves a color in the fountain fill for a shape
For more information, see Applying fountain fills.
FountainColors
Add method
Adds a color to the fountain fill for a shape
For more information, see Applying fountain fills.
FountainColors
Count property
Counts the number of colors between the start color and end color in the fountain fill for a shape
For more information, see Applying fountain fills.
GlobalMacroStorage
SelectionChange event
Is triggered when a selection is deactivated
For more information, see Deselecting shapes.
Layer
CreateArtisticText method
or
CreateArtisticTextWide method
Creates an artistic-text object on the specified layer
For more information, see Creating text objects.
Layer
CreateCurve method
Creates, on the specified layer, a line or a curve that is created “in memory” by using the Application.CreateCurve method
For more information, see Creating lines and curves.
Layer
CreateCurveSegment method
or
CreateCurveSegment2 method
Creates a basic curve on the specified layer
For more information, see Creating lines and curves.
Layer
CreateEllipse method,
CreateEllipse2 method,
or
CreateEllipseRect method
Creates an ellipse on the specified layer
For more information, see Creating ellipses.
Layer
CreateLineSegment method
Creates a basic line on the specified layer
For more information, see Creating lines and curves.
Layer
CreateParagraphText method
or
CreateParagraphTextWide method
Creates an paragraph-text object on the specified layer
For more information, see Creating text objects.
Layer
CreateRectangle method,
CreateRectangle2 method,
or
CreateRectangleRect method
Creates a rectangle on the specified layer
For more information, see Creating rectangles.
Layer
Shapes property
Contains the collection of shapes for a layer
For more information, see Selecting shapes.
Outline
Color property
Specifies the color of the outline for a shape
For more information, see Applying outlines.
Outline
Style property
Specifies the dash settings (that is, style properties) for the outline of a shape
For more information, see Applying outlines.
Outline
Type property
Specifies whether an outline is applied to a shape
For more information, see Applying outlines.
Outline
Width property
Specifies, in document units, the width of the outline for a shape
For more information, see Applying outlines.
Segment
AddNodeAt method
Adds a node to a line segment or a curve segment
For more information, see Creating lines and curves.
Shape
CreateBlend method
Applies a blend effect to a shape
For more information, see Applying blends.
Shape
CreateContour method
Applies a contour effect to a shape
For more information, see Applying contours.
Shape
CreateCustomDistortion method
Applies a customized distortion effect to a shape
For more information, see Applying distortions.
Shape
CreateCustomEffect method
Applies a customized effect to a shape
For more information, see Applying customized effects.
Shape
CreateDropShadow method
Applies a drop-shadow effect to a shape
For more information, see Applying drop shadows.
Shape
CreateEnvelope method,
CreateEnvelopeFromCurve method,
or
CreateEnvelopeFromShape method
Applies an envelope effect to a shape
For more information, see Applying envelopes.
Shape
CreateExtrude method
Applies an extrusion effect to a shape
For more information, see Applying extrusions.
Shape
CreateLens method
Applies a lens effect to a shape
For more information, see Applying lenses.
Shape
CreatePerspective method
Applies a perspective effect to a shape
For more information, see Applying perspective.
Shape
CreatePushPullDistortion method
Applies a Push-and-pull distortion effect to a shape
For more information, see Applying distortions.
Shape
CreateSelection method
Creates a selection from a single shape
For more information, see Selecting shapes.
Shape
CreateTwisterDistortion method
Applies a Twister distortion effect to a shape
For more information, see Applying distortions.
Shape
CreateZipperDistortion method
Applies a Zipper distortion effect to a shape
For more information, see Applying distortions.
Shape
Duplicate method
Duplicates a shape
For more information, see Duplicating shapes.
Shape
Evaluate method
Returns the result of a given expression that evaluates the properties of the current shape
For more information, see Searching for shapes.
Shape
GetBoundingBox method
Returns the size of a shape based on the size of its bounding box
For more information, see Sizing shapes.
Shape
GetPosition method
Returns the horizontal and vertical position of a shape
For more information, see Positioning shapes.
Shape
GetSize method
Returns the size of a shape
For more information, see Sizing shapes.
Shape
PlaceTextInside method
Places the selected text inside the specified shape
For more information, see Creating text objects.
Shape
PositionX property
Returns, or sets, the horizontal position of a shape
For more information, see Positioning shapes.
Shape
PositionY property
Returns, or sets, the vertical position of a shape
For more information, see Positioning shapes.
Shape
Rotate method
or
RotateEx method
Rotates a shape
For more information, see Rotating shapes.
Shape
Selected method
Specifies whether a shape is selected
For more information, see Selecting shapes.
Shape
SetBoundingBox method
Sets the size of a shape based on the size of its bounding box
For more information, see Sizing shapes.
Shape
SetPosition method
or
SetPositionEx method
Sets the position of a shape
For more information, see Positioning shapes.
Shape
SetSize method
or
SetSizeEx method
Sets the size of a shape
For more information, see Sizing shapes.
Shape
SizeHeight property
Returns, or sets, the height of a shape
For more information, see Sizing shapes.
Shape
SizeWidth property
Returns, or sets, the width of a shape
For more information, see Sizing shapes.
Shape
Skew method
or
SkewEx method
Skews a shape
For more information, see Skewing shapes.
Shape
Stretch method
or
StretchEx method
Stretches (or scales) a shape
For more information, see Stretching shapes.
Shape
Type property
Returns the type for a shape
For more information, see Determining shape type.
ShapeRange
CreateSelection method
Creates a selection from a range of shapes
For more information, see Selecting shapes.
ShapeRange
Duplicate method
Duplicates a range of shapes
For more information, see Duplicating shapes.
Shapes
All method
Returns all shapes from the specified collection of shapes
For more information, see Selecting shapes.
Shapes
FindShape method
Returns a single shape that has the specified properties
For more information, see Searching for shapes.
Shapes
FindShapes method
Returns, as a shape range, all shapes that have the specified properties
For more information, see Searching for shapes.
SubPath
AppendCurveSegment method
or
AppendCurveSegment2 method
Adds a curve-type segment to a subpath
For more information, see Creating lines and curves.
SubPath
AppendLineSegment method
Adds a line-type segment to a subpath
For more information, see Creating lines and curves.
Symbol
Definition property
Returns the definition of a symbol
For more information, see Creating symbols.
SymbolDefinition
NestedSymbols property
Contains the collection of all nested symbols for a symbol definition
For more information, see Creating symbols.
SymbolLibrary
Symbols property
Contains the collection of all symbol definitions for a symbol library
For more information, see Creating symbols.
Text
FitTextToPath method
Attaches the specified artistic text to the outline of a shape
For more information, see Creating text objects.
Text
Frames property
Represents a series of text frames (or TextFrame objects), each of which has its own text range (or TextRange object)
For more information, see Creating text objects.
Text
Story property
Represents a text range (or TextRange object) that includes all text in a series of text frames (or TextFrame objects)
For more information, see Creating text objects.

 
For detailed information on any property, method, or event, see the Object Model Reference.
In this topic

For more information on shape-related activities, see the following subtopics:

 
 
 
 
 
 
 
 
 

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.