Vecta

Vecta

The main Vecta namespace.

Classes

Control
Document
Guide
Layer
Length
Menu
Page
Plugin
Selection
Shape
Stencil
Symbol

Namespaces

.selection

Properties

.activeDocVecta.Document

NameTypeDescription
activeDocVecta.Document

The current active document.

Examples:
var id = Vecta.activeDoc.id(); //Get the active document and return the id

.activeLayerVecta.Layer

NameTypeDescription
activeLayerVecta.Layer

The current active layer.

Examples:
var layer_name = Vecta.activeLayer.name(); //Get the current active layer's name

.activePageVecta.Page

NameTypeDescription
activePageVecta.Page

The current active page.

Examples:
var count = Vecta.activePage.shapeCount(); //Get the number of shapes on the active page

Methods

.createStencil([name], [callback])

Creates a new stencil. By default, the user is the owner, except for stencils created in a team drawing where the team will be the owner.

NameTypeAttributesDefaultDescription
namestringoptionalUntitled Stencil

Name of the new stencil.

callbackfunctionoptional

Optional callback function to execute upon completion of create stencil.

Examples:
Vecta.createStencil(); //create a new stencil named "Untitled Stencil"

.loadStencil(id, [options], [callback])

Loads a stencil with the given ID.

NameTypeAttributesDescription
idstring

The ID of the stencil to load.

optionsobjectoptional

Optional parameters to determine how the stencil should be loaded.

NameTypeAttributesDefaultDescription
expandnumberoptionaltrue

To expand or collapse the stencil. True to expand, false to collapse.

namenumberoptional1

To show or hide symbol name. True to show, false to hide.

callbackfunctionoptional

Optional callback function to execute upon completion of loading stencil.

Examples:
Vecta.loadStencil('xxx'); //load the stencil with id === xxx onto the editor