Drawing Class Reference

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

Public Slots

int numberOf (int elementId)
 Returns the number of drawings in the element. More...
 
String name (int elementId, int drawingIndex)
 Returns the drawing id. More...
 
bool isExists (int elementId, String timing)
 Returns true if the given drawing exists in this element. More...
 
bool create (int elementId, String timing, bool fileExists, bool storeInProjectFolder=false)
 Creates a drawing. More...
 
String filename (int elementId, String drawingName)
 Returns 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

Creates a drawing.

Parameters
elementId: The unique id of the element.
timing: The proposed drawing name.
fileExists: Used to indicate that the drawing exists. By default, drawings exist in the temporary folder.
storeInProjectFolder: Indicate that the drawing exits in the project folder, not in a temporary folder.
Returns
Returns true if new drawing created. Returns false if not.

◆ filename

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

Returns 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
elementId: The unique id of the element.
drawingName: The drawing name.
Returns
Returns the 'load' filename of this drawing.

◆ isExists

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

Returns true if the given drawing exists in this element.

Parameters
elementId: The unique id of the element.
timing: The drawing name.

◆ name

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

Returns the drawing id.

Parameters
elementId: The unique id of the element.
drawingIndex: The drawing index.

◆ numberOf

int Drawing::numberOf ( int  elementId)
slot

Returns the number of drawings in the element.

Parameters
elementId: The unique id of the element.
Returns
Returns the number of drawings in the element.