# Type help("robolink") or help("robodk") for more information # Press F5 to run the script # Documentation: https://robodk.com/doc/en/RoboDK-API.html # Reference: https://robodk.com/doc/en/PythonAPI/index.html # Note: It is not required to keep a copy of this file, your python script is saved with the station from robolink import * # RoboDK API from robodk import * # Robot toolbox RDK = Robolink() #robot=RDK.Item('Mitsubishi RV-7FL') robot = RDK.ItemUserPick('Select a robot', ITEM_TYPE_ROBOT) if not robot.Valid(): raise Exception('No robot selected or available') P1=RDK.Item('Targetc 1') P2=RDK.Item('Targetc 2') # It is important to provide the reference frame and the tool frames when generating programs offline robot.setPoseFrame(robot.PoseFrame()) robot.setPoseTool(robot.PoseTool()) robot.setZoneData(10) # Set the rounding parameter (Also known as: CNT, APO/C_DIS, ZoneData, Blending radius, cornering, ...) robot.setSpeed(200) # Set linear speed in mm/s reg = [1] reg[0] = 1 #if reg[1] == 0: if reg[0] == 0: print("states") robot.MoveJ(P1) robot.MoveL(P2) else: robot.MoveJ(P2) robot.MoveJ(P1) time.sleep(2)