OMC::ElementDrawing Class Reference

Detailed Description

Represents a drawing belonging to an element.

Provides the methods needed to manipulate a drawing that is managed by an Element. These are the underlying drawings available to the element, and may contain more drawings that those that are exposed on the timeline.

List All Drawings in All Elements

from ToonBoom import harmony #Import the Harmony Module
sess = harmony.session() #Get access to the Harmony session, this class.
proj = sess.project #Get the active session's currently loaded project.
elems = proj.elements #The element list of all elements in the project.
print( "Element Count: %s"%(len(elems)) )
for elem in elems: #Expectation: All names of all scenes in the project printed.
print( "Element Name: %s"%(elem.name) )
element_drawings = elem.drawings
print( " Contains %s Drawings : "%(len(element_drawings)) )
for element_drawing in element_drawings:
print( " %s"%(element_drawing.name) )

Create a New Element with A Drawing

from ToonBoom import harmony #Import the Harmony Module
sess = harmony.session() #Get access to the Harmony session, this class.
proj = sess.project #Get the active session's currently loaded project.
elems = proj.elements #The element list of all elements in the project.
#Create the new Element
new_element = elems.create( "NEW_ELEMENT_NAME", "COLOR", 12.0, "SCAN", "TVG" )
print( "New Element Created: %s"%(new_element.id) )
#Create a new drawing.
new_drawing = new_element.drawings.create( "DRAWING_NAME_001", False, True )
print( "New Drawing Created: %s"%(new_drawing.name) )

Public Member Functions

OMC::Obj duplicate (const QString &newName=QString(), const QString &layer=QString()) const
 Duplicate the drawing and provide the new drawing in return.
 

Public Attributes

QString id
 Provides the unique drawing id (same as OMC::ElementDrawing::name).
 
QString name
 Provides the unique drawing name.
 
QString path
 Provides the path to the drawing.
 
bool deleted
 Identifies if the drawing has been deleted.
 
bool file_exists
 Identifies if the drawing file exists.
 
bool used
 Identifies if the drawing is being used.
 
OMC::Elementelement
 Get the parent element that owns this drawing.
 
QString type
 Identifies the drawing-type.
 
double scale_factor
 Get/set the drawing scale factor.
 
int version
 Get/set the drawing version.
 
Inheritance diagram for OMC::ElementDrawing:
Collaboration diagram for OMC::ElementDrawing: