RoboDK Forum
Force Original Pose (Set tool)- 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)
+--- Thread: Force Original Pose (Set tool) (/Thread-Force-Original-Pose-Set-tool)



Force Original Pose (Set tool)-ANDY_F1-11-30-2021

Hi
When generating a program through the C# API I am setting the tool.
The 'Force original pose' option is automatically selected.
How can I deselect this through the API when I generate the instruction for set tool?

I use the code on the instruction at the moment

Program.setInstruction(insID, name, instrType, movetype, jointTarget, target, joints);

Regards
Andy


RE: Force Original Pose (Set tool)-Jeremy-11-30-2021

I'm transferring this to the API section.

Jeremy


RE: Force Original Pose (Set tool)-Albert-12-01-2021

Hi Andy,

We just updated our API so you can use the parameter ForcePose with setParam on a program.
For example, if your instruction to change the tool is the second instruction (index 1), you can do:

Code:
from robolink import *
RDK = Robolink()
p = RDK.Item('', ITEM_TYPE_PROGRAM)

# Modify instruction 2 of program p (Set Tool, instruction id=1)
instruction_data = p.setParam(1)
print(instruction_data)
instruction_data["ForcePose"] = 1 # 1=checked, 0=unchecked
p.setParam(1, instruction_data)

# Or simply apply your desired modification:
instruction_data = {}
instruction_data["ForcePose"] = 1 # 1=checked, 0=unchecked
p.setParam(1, instruction_data)
A more complete example is available here:
//m.sinclairbody.com/doc/en/PythonAPI/examples.html#modify-program-instructions


RE: Force Original Pose (Set tool)-Jeremy-12-01-2021

You need to update RoboDK to the latest version to access this new feature.

Jérémy


RE: Force Original Pose (Set tool)-ANDY_F1-12-02-2021

that's great thanks guys