I’m trying to create linear motion statements with python.
It creates the statements in the program with correct position and everything (tool, base, etc), but when I double click on the statement the robot doesn’t move to its location.
Below is part of the code I’m using, what is wrong?
Program = executor.Program
Routine = Program.findRoutine(‘XCAL’)
if Routine != None:
Program.deleteRoutine(Routine)
Routine = Program.addRoutine(‘XCAL’)
… some other code here…
count += 1
sName = “XCAL%d” % count
Statement = Routine.addStatement(VC_STATEMENT_LINMOTION)
Statement.Base = Base1
Statement.Tool = controller.Tools[0]
PositionFrame = Statement.createPosition(sName)
PositionFrame.PositionInReference = TargetPos