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

Add a shape as a tool using the python API


I have some code to create a shape: 
shape = RDK.AddShape(triangles)

And I know how to create a tool:
robot.AddTool(mat, name)

But I can't work out how to make the shape become the tool. I want the same result as dragging the shape to the robot in the UI, but I need to use the API.

I found it...

tool_item = robot.AddTool(robodk.Mat(mat))
shape = RDK.AddShape(triangles)
tool_item.AddGeometry(shape, robodk.eye())

Users browsing this thread:
1 Guest(s)