# 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

#### ART_LAYER

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

#### colorArt$.oArtLayer

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

#### idint

  The internal Id used to identify drawings.

#### LINE_END_TYPE

  The different types of lines ends.

#### lineArt$.oArtLayer

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

#### namestring

  The name of the drawing.

#### overlay$.oArtLayer

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

#### pathstring

  The folder path of the drawing on the filesystem.

#### pivot$.oPoint

  The drawing pivot of the drawing.

#### underlay$.oArtLayer

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

### Methods

#### copyContents(artLayer)

openHarmony/openHarmony_drawing.js, line 339
  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

#### getVisibleFrames(){Array.<int>}

openHarmony/openHarmony_drawing.js, line 235

  ##### Returns:

  Type | Description
  --- | ---
  Array.<int> | The frame numbers at which this drawing appears.

#### importBitmap(file){$.oDrawing}

openHarmony/openHarmony_drawing.js, line 223
  Import a given file into an existing drawing.

  Name | Type | Description
  --- | --- | ---
  `file` | string | The path to the file

  ##### Returns:

  Type | Description
  --- | ---
  $.oDrawing | The drawing found by the search

#### pasteContents(artLayer)

openHarmony/openHarmony_drawing.js, line 359
  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 290
  refresh the preview of the drawing.

#### remove()

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

#### setAsActiveDrawing(artLayer){bool}

openHarmony/openHarmony_drawing.js, line 309
  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 380
  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 411
  Converts the Drawing object to a string of the drawing name.