RoboDK Forum
Modify MoveL to MoveJ- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: Modify MoveL to MoveJ (/Thread-Modify-MoveL-to-MoveJ)



Modify MoveL to MoveJ-AlejandroSeikiRobotics-01-29-2021

Hello everybody,

I am trying to modify all MoveL instructions of a program by MoveJ.

I have looked at the Modify Program Instruction example (//www.sinclairbody.com/doc/en/PythonAPI/examples.html#modify-program-instructions) but when I list the MoveL parameters (dict) I only get the name.

e.g. {'Name': 'MoveL 45', 'Type': 0}

Is it possible to do this through a python script?

Thanks in advance.


RE: Modify MoveL to MoveJ-Jeremy-01-29-2021

Hi Alejandro,

From the example you pointed to:


Code:
elif instruction_dict['Type'] == INS_TYPE_MOVE:
print("Move instruction: use setInstruction to modify target")
#ins_name, ins_type, move_type, isjointtarget, pose, joints = prog.Instruction(ins_id)
#prog.setInstruction(ins_id, ins_name, ins_type, move_type, isjointtarget, pose, joints)

In the line:prog.setInstruction(ins_id, ins_name, ins_type, move_type, isjointtarget, pose, joints)
you have the move_type.

If you open the robolink.py (C:\RoboDK\Python), you can find these:
Code:
# Instruction types
INS_TYPE_INVALID = -1
INS_TYPE_MOVE = 0
INS_TYPE_MOVEC = 1
INS_TYPE_CHANGESPEED = 2
INS_TYPE_CHANGEFRAME = 3
INS_TYPE_CHANGETOOL = 4
INS_TYPE_CHANGEROBOT = 5
INS_TYPE_PAUSE = 6
INS_TYPE_EVENT = 7
INS_TYPE_CODE = 8
INS_TYPE_PRINT = 9

# Move types
MOVE_TYPE_INVALID = -1
MOVE_TYPE_JOINT = 1
MOVE_TYPE_LINEAR = 2
MOVE_TYPE_CIRCULAR = 3
MOVE_TYPE_LINEARSEARCH = 4 # Such as ABB's SearchL function


Have a great day.
Jeremy


RE: Modify MoveL to MoveJ-AlejandroSeikiRobotics-02-01-2021

I was very close! But I didn't see it.
It works perfectly.

Thank you very much Jeremy and have a nice day.