Document Object

The Document object is used to control a ConceptDraw document and its contents. It includes all the necessary properties and methods for working with the contents of the document: pages, layers, colors, styles, hyperlinks, color palette, various document settings, etc.

Properties

Name Description
ActiveLayer Active layer ID (the ID property).
ActivePage Read-only. Active page of the document.
ActiveView Read-only. Active window of the document (represents an instance of the active document view).
Author Describes the document's author.
Company Describes the company which created the document.
CustomMenu Read-only. Returns the user-defined menu of the document.
DefCharacter Read-only. The sequence of characters, assigned to the new shape's text by default.
DefFillColor Read-only. Default fill color for new shapes.
DefFillPatColor Read-only. Default fill pattern color, applied by default to every new shape.
DefFillPattern The type of fill pattern, applied by default to every new shape.
DefParagraph Read-only. Paragraph properties, applied by default to every new shape.
DefPenColor Read-only. Default line color for new shapes.
DefPenPattern The type of line pattern, applied by default to every new shape.
DefPenWeight Default line weight for new shapes.
DefShadowColor Read-only. Default shadow color for new shapes.
DefShadowPatColor Read-only. The shadow fill color, applied by default to every new shape.
DefShadowPattern Read-only. The type of shadow pattern, applied by default to every new shape.
DefStyle Default style, applied to all new shapes.
DefTextBlock Read-only. The text block, assigned by default to every new shape.
Desc Detailed description of the document.
FlowAroundObjects A flag that specifies whether smart connectors should flow around shapes on their way.
FullName Read-only. Returns the full filename of the document.
LineJumpOrient

Orientation of smart connector's crossings in the document.

LineJumpSize The size of smart connector's crossings in the document.
LineJumpType The type of smart connector's crossings in the document.
MaxNumberOfLegs The maximum number of Smart Connector's legs.
MinDistToShapes The minimum possible distance between a a smart connector and any other shapes on the page, on which the smart connector is located.
Name Document file name.
PageSizeX Document page width. It's specified in internal units of ConceptDraw (InternalUnit).
PageSizeY Document page height. It's specified in internal units of ConceptDraw (InternalUnit).
PassThroughGroups A flag that specifies whether the smart connectors in the document should flow around the whole group (False) or individual shapes inside the group on the connector's way (True).
Path Path to the document filename.
Scale Scale, set in the document.
ShadowOffsetX Horizontal shadow offset.
ShadowOffsetY Vertical shadow offset.
SnapSensitivity Current snap sensitivity for the document.
SplineSmooth Current spline smoothness for the document.
Subj Brief description of the document.
Title Title of the document.
UnitIndex Units of measure of the document.

Methods

Name Description
AddHyperlinkToDocument Adds a hyperlink to a ConceptDraw document.
AddHyperlinkToFile Adds a hyperlink to a local file.
AddHyperlinkToPageShape Adds a hyperlink to a shape or a page of the current document.
AddHyperlinkToURL Adds a hyperlink to a URL.
AddLayer Adds a new layer to the document's layer collection.
AddPage Adds a new page to the document.
AddStyle Adds a new style to the document's style collection.
ColorEntry

Returns a color from the color table by its index in the color collection of the document.

ColorsNum Returns the number of colors in the color table of the document.
EndRebuild Informs the ConceptDraw engine about the termination of modifying properties of the shapes of the document.
Export Exports the document to the specified file format.
FindFontByName Returns the font's index in the document's font collection.
FindPage Returns the page's index in the document's page collection.
FindStyle Returns the style's index in the document's style collection.
FirstView Returns the first window in the document's window collection.
FontName

Returns the font name by the specified font index in the document's font collection.

FontsNum Returns the number of fonts in the document's font collection.
Hyperlink

Returns a hyperlink by the specified index in the document's hyperlink collection.

HyperlinkByID Searches for a hyperlink by the specified ID in the document's hyperlink collection.
HyperlinksNum Returns the number of hyperlinks in the document's hyperlink collection.
Layer Returns a layer by the specified index in the document's layer collection.
LayerByID Searches for a layer by its ID (the ID property) in the document's layer collection.
LayerByName Searches for a layer by its name (the Name property) in the document's layer collection.
LayersNum Returns the number of layers in the document's layer collection.
NextView Returns the next window from the document's window collection.
Page Returns a page by its index in the document's page collection.
PageByID

Searches for a page by its ID (the ID property) in the document's page collection.

PagesNum Returns the number of pages in the document.
RemoveLayer Removes a layer by its index in the document's layer collection.
RemoveLayerByID Removes a layer with the specified ID (the ID property) from the document.
RemovePage Removes a page by its index in the document's page collection.
RemovePageByID Removes a page with the specified ID (the ID property) from the document.
RemoveStyle Removes a style by its index in the document's style collection.
RemoveStyleByName

Removes a style with the specified name (the Name property) from the document's style collection.

RemoveUnusedHyperlinks Removes unused hyperlinks from the document's hyperlink collection.
RenameStyle Renames a style.
ReorderPage Reorders pages in the document's page collection. The page being moved is defined by the index in the page collection of the document.
ReorderPageByID

Reorders pages in the document's page collection. The page being moved is defined by its ID (the ID property) in the page collection of the document.

Save Saves the document.
SaveAs Saves the document with the specified parameters.
SetActivePage Sets an active page in the document by its index.
SetActivePageByID Sets an active page in the document by its ID.
SetActiveView Activates the specified view of the document.
StartRebuild Informs the ConceptDraw engine about the beginning of modifying properties of the shapes of the document.
Style

Returns a style by the specified index in the document's style collection.

StyleByName

Searches for a style with the specified index in the document's style collection.

StylesNum Returns the number of styles in the document's style collection.
UpdateAllViews Redraws all windows of the document.
ViewByID Searches for the window with the specified ID (the ID property) in the view collection of the document.
ViewsNum Returns the number of views of the current document.

Remarks

Documents, opened in the application, can be located in the application only. The Application object has a number of methods for controlling ConceptDraw documents, opened in the application. However, methods and properties of the Application object are not the only means to retrieve an instance of the Document object. Other objects that belong to or are associated with the document can refer to it.

Apart from controlling all the collections stored in a ConceptDraw document (pages, layers, hyperlinks, styles, color palette) the Document object provides access to all windows which display the contents of the document, and also allows to control re-calculation of properties of the document's shapes (StartRebuild, EndRebuild), redraw the document's windows (UpdateAllViews), etc.

An instance of the Document object can be retrieved from the following methods and properties:
Application object: ActiveDoc property, CreateNewDoc method, Doc method, DocByName method, FirstDoc method, Import method, NextDoc method, OpenDoc method.
Page, ServObj, Shape objects: Document property.
Window object: Document property.

Also an instance of the Document object can be retrieved by using the thisDoc global variable, pre-defined at document script, page script, shape script levels. The thisDoc variable in the document-level script returns the document which script is being executed when the variable is referred to. For the page/shape-level script it returns the document, to which belongs the page/shape, which script is being executed.

 

See Also

Application object, Hyperlink object, Layer object, Page object, Style object, Window object