Run Program Instruction from API- Printable Version +- RoboDK Forum (//m.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//m.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//m.sinclairbody.com/forum/Forum-RoboDK-API) 从API(+——线程:运行程序指令/Thread-Run-Program-Instruction-from-API) |
Run Program Instruction from API-Jacob-02-05-2020 Hey guys, We are trying to execute a specific instruction from a robot program using the python api. We looked at RunInstruction() but that didnt seem to be quite what we were looking for. We are iterating thru the list of instruction and just want to execute the move commands from the file. Here is the while loop that searches the program, but doesnt execute. Thanks
Code:
# Iterate through all the instructions in a program:
RE: Run Program Instruction from API-Albert-02-05-2020 嗨Jacob, You can't run a specific instruction using the API, however, you can execute that on the robot item. For example, if you have a linear move instruction to a Cartesian target you can do:
Code:
robot.MoveL(pose)
Albert RE: Run Program Instruction from API-Jacob-02-05-2020 (02-05-2020, 06:55 PM)Albert Wrote:嗨Jacob, Sounds great @Albert, what if we have some moveC types? We see the pose info for moveL but no pose info for MoveC
Code:
print(prog.Instruction(ins_id))
Also is there a way to show a target for a specific instruction without showing all the targets for a given program? such as prog.ShowTargets()? RE: Run Program Instruction from API-Albert-04-28-2020 嗨Jacob, You can right click an instruction and select "Select Target" to see the target for that specific instruction. It is not possible to show targets only for specific instructions using the API. Albert |