OMC::CableList Class Reference

Detailed Description

Provides a list of OMC::Cables attached to an OutPort.

The CableList provides a dynamic list of cables attached to an OutPort, that connect the port to an InPort of another Node.
This is provided from OutPort::cables

List Cables Attached to a Node's Port

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.
scene = proj.scene #Get the top scene in the project.
peg = scene.nodes["Top/Peg"] #Find the peg node.
out_port = peg.ports_out[0] #The first Out Port of a node.
cablelist = out_port.cables
print( "Number of Cables : %s"%len( cablelist ) ) #Print the amount of cables attached to the port.
for idx,cable in enumerate(cablelist):
print( "Cable %s : %s"%(idx, cable.destination_node.path) ) #Print what the cable is connected to.

Public Member Functions

bool contains (OMC::Cable *) const
 Identifies if the list contains the cable.
 
virtual std::vector< OMC::Cable * > list () const override
 Converts the dynamic list into a concrete list of cable objects.
 
virtual OMC::Cableoperator() (const QString &searchString) const
 Search for an cable in the node with a specialized search string. Search string formatting to be discussed. More...
 

Public Attributes

OMC::Cableoperator[int idx]
 The CableList object is is iterable and can provide values at given index with the list operator. More...
 

Member Function Documentation

◆ operator()()

virtual OMC::Cable* OMC::CableList::operator() ( const QString &  searchString) const
virtual

Search for an cable in the node with a specialized search string. Search string formatting to be discussed.

Returns
The cable found at the given string.

Member Data Documentation

◆ operator[int idx]

OMC::Cable* OMC::CableList::operator[int idx]

The CableList object is is iterable and can provide values at given index with the list operator.


Print Column Values

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.
scene = proj.scene #Get the top scene in the project.
peg = scene.nodes["Top/Peg"] #Find the peg node.
try:
out_port = peg.ports_out[0] #The first Out Port of a node.
cablelist = out_port.cables
print( "Port has %s Cables"%(len(cablelist)) )
for n in range( len(cablelist) ):
print( "%s Cable : %s"%(n, cablelist[n].destination_node.path) )
except:
print( "Failed, does the node or port exist?" )
Inheritance diagram for OMC::CableList:
Collaboration diagram for OMC::CableList: