Programming Path Statement in Python

Instead of Teaching a path of positions I want to create it within a python script.

Currently I read the positions from a file, create VC_Compactlineset and program the path statemant via the Robot-Program-Editor and edit motion marameters or the point density.

I know how to create a statement but I don’t know how to fill it with positions and how to edit the statement’s parameters and modify each point in python api.


Maybe the following code snippet could be helpful for your. It creates a target using the current robot position and sets it as the statement’s position:

active_robot = app.TeachContext.ActiveRobot
controller = active_robot.getBehavioursByType('rSimRobotController')[0]
new_target = controller.createTarget()
statement.Base = new_target.BaseName
statement.Tool = new_target.ToolName
statement.Name = "Statement's Name"
statement_position = statement.createPosition("Position's name") #this string is shown within the 3D-View 
statement_position.PositionInWorld = new_target.Target

Schema is used to manage positions of path statement. Unfortunately, the Python API for path statement is still in development. A video tutorial on this topic will be made once the API is made available to end users.