Here is an example of how truth value checking works in this API.
Objects from this API are considered false when:
Python Docs on Truth Value Checking
import Editor
import Vertex
import VertexArray
if docExists:
print( "Document exists." )
if not nullDoc:
print( 'Document does not exist' )
if not vertexArray:
print( 'The array is empty' )
vertexArray.Insert( vertex )
if vertexArray:
print( 'The array is not empty' )
soundList = docExists.GetSoundList()
soundList.AddSound( "someSound.mp3" )
soundItem = soundList.GetSoundItem( 0 )
if soundItem:
print( 'This SoundItem exists' )
soundList.RemoveSound( soundItem )
if not soundItem:
print( 'This SoundItem no longer exists' )
Document OpenDocument(String fileName)
Opens a new document and makes it the current document.
Document NewDocument(String filename="")
Creates a new document and makes it the current document.
VertexArray()
default ctor
Vertex()
Default constructor.