Class: oDrawing

$. oDrawing

The $.oDrawing Class represents a single drawing from an element.

new $.oDrawing(name, oElementObject)

openHarmony/openHarmony_drawing.js, line 62
The $.oDrawing constructor.
Name Type Description
name int The name of the drawing.
oElementObject $.oElement The element object associated to the element.
Properties:
Name Type Description
name int The name of the drawing.
element $.oElement The element object associated to the element.

Members

activeArtLayer$.oArtLayer

the currently active art layer of this drawing.

ART_LAYER

The reference to the art layers to use with oDrawing.setAsActiveDrawing()

readonlyartLayersArray.<$.oArtLayer>

The list of artLayers of this drawing.

readonlyboundingBox$.oBox

The bounding box of the drawing, in drawing space coordinates. (null if the drawing is empty.)

readonlycolorArt$.oArtLayer

Access the color art layer's content through this object.

contoursArray.<$.oContour>

The contours contained amongst all the shapes of the artLayer.

readonlyidint

The internal Id used to identify drawings.

LINE_END_TYPE

The different types of lines ends.

readonlylineArt$.oArtLayer

Access the line art layer's content through this object.

namestring

The name of the drawing.

readonlyoverlay$.oArtLayer

Access the overlay art layer's content through this object.

readonlypathstring

The folder path of the drawing on the filesystem.

pivot$.oPoint

The drawing pivot of the drawing.

selectedContours$.oShape

the selected shapes on this drawing

selectedShapes$.oShape

the selected shapes on this drawing

selectedStrokes$.oShape

the selected shapes on this drawing

readonlyshapesArray.<$.oShape>

the shapes contained amongst all artLayers of this drawing.

readonlystrokesArray.<$.oStroke>

the strokes contained amongst all artLayers of this drawing.

readonlyunderlay$.oArtLayer

Access the underlay art layer's content through this object.

usedColorIdsArray.<string>

The color Ids present on the drawing.

Methods

copyContents(artLayer)

openHarmony/openHarmony_drawing.js, line 589
Copies the contents of the Drawing into the clipboard
Name Type Description
artLayer oDrawing.ART_LAYER optional Specify to only copy the contents of the specified artLayer

duplicate(frame, newName){$.oDrawing}

openHarmony/openHarmony_drawing.js, line 567
Duplicates the drawing to the given frame, and renames the drawing with the given name.
Name Type Description
frame int optional the frame at which to create the drawing. By default, the current frame.
newName string optional A new name for the drawing. By default, the name will be the number of the frame.
Returns:
Type Description
$.oDrawing the newly created drawing

getVisibleFrames(){Array.<int>}

openHarmony/openHarmony_drawing.js, line 463
Returns:
Type Description
Array.<int> The frame numbers at which this drawing appears.

importBitmap(file, convertToTvg){$.oFile}

openHarmony/openHarmony_drawing.js, line 433
Import a given file into an existing drawing.
Name Type Default Description
file $.oFile The path to the file
convertToTvg bool false optional Wether to convert the bitmap to the tvg format (this doesn't vectorise the drawing)
Returns:
Type Description
$.oFile the oFile object pointing to the drawing file after being it has been imported into the element folder.

pasteContents(artLayer)

openHarmony/openHarmony_drawing.js, line 609
Pastes the contents of the clipboard into the Drawing
Name Type Description
artLayer oDrawing.ART_LAYER optional Specify to only paste the contents onto the specified artLayer

refreshPreview()

openHarmony/openHarmony_drawing.js, line 516
refresh the preview of the drawing.

remove()

openHarmony/openHarmony_drawing.js, line 485
Remove the drawing from the element.

replaceColorId(currentId, newId)

openHarmony/openHarmony_drawing.js, line 580
Replaces a color Id present on the drawing by another.
Name Type Description
currentId string
newId string

setAsActiveDrawing(artLayer){bool}

openHarmony/openHarmony_drawing.js, line 535
Change the currently active drawing. Can specify an art Layer Doesn't work in batch mode.
Name Type Description
artLayer oDrawing.ART_LAYER optional activate the given art layer
Returns:
Type Description
bool success of setting the drawing as current

setLineEnds(endType, artLayer)

openHarmony/openHarmony_drawing.js, line 630
Converts the line ends of the Drawing object to the defined type. Doesn't work in batch mode. This function modifies the selection.
Name Type Description
endType oDrawing.LINE_END_TYPE the type of line ends to set.
artLayer oDrawing.ART_LAYER optional only apply to provided art Layer.

toString()

openHarmony/openHarmony_drawing.js, line 662
Converts the Drawing object to a string of the drawing name.