# Type help("robodk.robolink") or help("robodk.robomath") 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/robodk.html # Note: It is not required to keep a copy of this file, your Python script is saved with your RDK project # You can also use the new version of the API: from robodk import robolink # RoboDK API from robodk import robomath # Robot toolbox RDK = robolink.Robolink() # Forward and backwards compatible use of the RoboDK API: # Remove these 2 lines to follow python programming guidelines from robodk import * # RoboDK API from robolink import * # Robot toolbox # Link to RoboDK # RDK = Robolink() robot = RDK.Item('', ITEM_TYPE_ROBOT) tool = robot.getLink(ITEM_TYPE_TOOL) tool_relation = tool.GeometryPose() - tool.PoseTool() #mbox ("active tool: " + tool.Name()) #mbox (tool.GeometryPose()) #mbox (tool.PoseTool()) #mbox (tool_relation) def MainAction(): #tool_relation = tool.GeometryPose() - tool.PoseTool() while True: tool.setPoseTool(tool.GeometryPose() - tool_relation) def runmain(): """ Entrypoint of this action when it is executed on its own or interacted with in RoboDK. Important: Use the function name 'runmain()' if you want to compile this action. """ if roboapps.Unchecked(): roboapps.Exit() else: MainAction() if __name__ == '__main__': runmain()