Robot Statement Names Not accessible?

Hello All l am trying to write a script to manipulate the names of statements in a robot program.
But I cant seem to access the Name property of the statements.

from vcScript import *

comp = getComponent() 
program = comp.getBehaviour("Executor").Program

sourceRoutine = program.findRoutine("Zone 1")
destinationRoutine = program.findRoutine("Zone 1 Ref")

statement = sourceRoutine.getStatement(0)
print statement.Name

Thats my Code but nothing gets printed on the output window and I cant seem to write a new name into it either.

if I use the same code but instead just
print statement

the output window does show <vcMotionStatement Object at 0x00000######>

so I know I am grabbing the statement but for some reason can not grab and modify the Name Property

Any Ideas Why


and so:

statement = sourceRoutine.getStatement(0).Positions[0]
print statement.Name



Wow Huge thanks man.
I could not figure that out from the documentation.
after seeing your code I went back and looked through the documentation and finally found where the vcPositionFrame objects come into play. But not very intuitive.

Saved me alot of headache thanks man

You’re welcome.