|
|
int | numberOf () |
| Returns the number of elements in the scene. More...
|
|
int | id (int elementIndex) |
| Returns the id (key) of the element. More...
|
|
String | getNameById (int elementId) |
| Returns the current element name. More...
|
|
String | scanType (int elementId) |
| Returns a string that is the scan type of the element. The scan type is either: COLOR, GRAY_SCALE or BW. More...
|
|
double | fieldChart (int elementId) |
| This function returns the field chart size for a given element. The element ID must be provided. The field chart is a number such as 12,16 or 24 field. More...
|
|
int | vectorType (int elementId) |
| This function returns the vector type for the given element. For standard vector or Toon Boom bitmap drawing, the vector type will be TVG. More...
|
|
String | pixmapFormat (int elementId) |
| Returns the pixmap format for the provided element ID. More...
|
|
String | folder (int elementId) |
| Returns the actual element folder. This is normally the element name (unless it has been renamed and the project is not saved) but may include the ".<element id>" in the name if multiple elements share the same name. More...
|
|
String | completeFolder (int elementId) |
| Returns the complete element folder. This is normally the element name (unless it has been renamed and the project is not saved) but may include the ".<element id>" in the name if multiple elements share the same name. More...
|
|
String | physicalName (int elementId) |
| Returns the actual name of the drawings. This is different that the element name if this one has been renamed and the changes have not yet been saved. More...
|
|
|
bool | modify (int elementId, String scanType, double fieldChart, String pixmapFormat, int vectorType) |
| Changes the attributes of the folder of element elem. More...
|
|
int | add (String name, String scanType, double fieldChart, String fileFormat, String vectorFormat) |
| Creates a new element. Returns the element id of the newly added element if successful, otherwise it returns -1. More...
|
|
bool | remove (int elementId, bool deleteDiskFile) |
| Removes the given element. Optionally delete the disk files. This function returns true when successful. More...
|
|
bool | renameById (int elementId, String name) |
| Renames an existing element. The element ID must be provided. More...
|
|
The element JavaScript global object. Add, remove, modify or get information about element nodes in the scene.
An element is a physical group of drawings that can be found in the scene's element folder. The element folder will be located in the temporary folder until the scene is saved. The element global object can add, remove or retrieve information about the elements of a scene. Each element has an index (0..nbElements-1) and an integer id (key of the element in the database) which is unique. Their name is not guaranteed to be unique.
function addElement()
{
var
id =
element.
add(
"newDrawing",
"BW", 12,
"TVG",
"SCAN");
}
var nodePath = "Top/Drawing";
var newElementName = elementName + "_Suffix";
int element::vectorType |
( |
int |
elementId | ) |
|
|
slot |
This function returns the vector type for the given element. For standard vector or Toon Boom bitmap drawing, the vector type will be TVG.
The value 0: indicates that the element is NOT a vector drawing (It is an IMAGE type, ex: PNG, TGA, PSD images). The value 1: indicates that the element is a PNT (obsolete) vector drawing. The value 2: indicates that the element is a TVG vector drawing.
- Parameters
-
elementId | : The unique id of the element. |
- Returns
- Returns the vector type for the given element.