Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Modify MoveL to MoveJ

#1
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/exam...structions) 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.
#2
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
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYoutube Channel.


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

Thank you very much Jeremy and have a nice day.




Users browsing this thread:
1 Guest(s)