Harmony
Scripting Interface Documentation
Drawing Class Reference

The Drawing JavaScript global object. Iterate and manipulate the drawings of an element node. More...

Public Slots

int numberOf (int elementId)
 return the # of drawings in the element. More...
 
String name (int elementId, int drawingIndex)
 return the drawing id. More...
 
bool isExists (int elementId, String timing)
 return true if the given drawing exists in this element. More...
 
bool create (int elementId, String timing, bool fileExists, bool storeInProjectFolder=false)
 create a drawing. More...
 
String filename (int elementId, String drawingName)
 return the 'load' filename of this drawing. This filename may be in the temp folder or project folder. Before the project is actually saved, this is where the drawing must reside to be found by the application. More...
 

Detailed Description

The Drawing JavaScript global object. Iterate and manipulate the drawings of an element node.

for(var nodeIt in allNodes)
{
if(allNodes.hasOwnProperty(nodeIt))
{
var layerName = node.getTextAttr(allNodes[nodeIt], 1, "drawing.element.layer");
var ElementId = node.getElementId(allNodes[nodeIt]);
for(var j = 0 ; j < Drawing.numberOf(ElementId); j++ )
{
var drawingId = Drawing.name(ElementId,j);
DrawingTools.recolorDrawing({ elementId : ElementId, layer : layerName, exposure : drawingId },this.mapping);
}
}
}

Member Function Documentation

◆ create

bool Drawing::create ( int  elementId,
String  timing,
bool  fileExists,
bool  storeInProjectFolder = false 
)
slot

create a drawing.

Parameters
elementIdthe unique id of the element
timingthe proposed drawing name.
fileExistsused to indicate that the drawing exists. By default, drawings exists in the temporary folder.
storeInProjectFolderindicate that the drawing exits in the project folder, not in a temporary folder.
Returns
true if new drawing created. false if not.

◆ filename

String Drawing::filename ( int  elementId,
String  drawingName 
)
slot

return the 'load' filename of this drawing. This filename may be in the temp folder or project folder. Before the project is actually saved, this is where the drawing must reside to be found by the application.

Parameters
elementIdthe unique id of the element
drawingNamethe drawing name

◆ isExists

bool Drawing::isExists ( int  elementId,
String  timing 
)
slot

return true if the given drawing exists in this element.

Parameters
elementIdthe unique id of the element
timingthe drawing name

◆ name

String Drawing::name ( int  elementId,
int  drawingIndex 
)
slot

return the drawing id.

Parameters
elementIdthe unique id of the element
drawingIndex

◆ numberOf

int Drawing::numberOf ( int  elementId)
slot

return the # of drawings in the element.

Parameters
elementIdthe unique id of the element