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

Pont information form Curve follow (API)

#1
Hi Sir
I would want to use API to execute related curve follow projects

How to use RobotdkAPI to get the point information from the curve Follow?
(MoveJ1,MoveL2,MoveL3,MoveL4) 

[Image: attachment.php?aid=2758]
#2
Please refer to the following example:

https://robodk.com/doc/en/PythonAPI/exam...structions

Code:
# This example shows how to read program instructions
# See also:
# https://robodk.com/doc/en/PythonAPI/robodk.html#robodk.robolink.Robolink.AddProgram

from robodk.robolink import *  # API to communicate with RoboDK

# Start the RoboDK API
RDK = Robolink()

# Ask the user to select a program:
prog = RDK.ItemUserPick("Select a Program to modify", ITEM_TYPE_PROGRAM)
if not prog.Valid():
    print("Operation cancelled or no programs available")
    quit()

# Ask the user to enter a function call that will be added after each movement:
print("Program selected: " + prog.Name())

# Iterate for all instructions (index start is 0, you can also use -1 for the last instruction)
ins_count = prog.InstructionCount()
ins_id = 0
while ins_id < ins_count:
    # Get specific data related to an instruction
    # This operation always retuns a dict (json)
    instruction_dict = prog.setParam(ins_id)

    # Print instruction data
    #indented_values = json.dumps(instruction_dict, indent=4)
    print("\n\nInstruction: " + str(ins_id))
    print(instruction_dict)
    ins_id+=1
  




Users browsing this thread:
1 Guest(s)