Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Access points from an item
#1
Hey!

I am not that familiar with Python yet.
Nevertheless, I added an item with points to an object by

points = obj.AddPoints(PointsDataList,False,...)

which is also shown in the RoboDK window/tree.

The Question is: in which way are the generated points accessible from Python? (e.g. extract the points if the rdk file is reloded)


Thanks.
#2
It is currently not possible to extract the points from an object.
Something you can do instead is to save it as a station parameter with getParam/setParam :
RDK.setParam('POINTS', str(POINTS))
Station parameters are saved together with the RDK file as strings.
然后,您可以检索列表:
import json
POINTS = json.loads(RDK.Param())

Right now, what you can do with the points object is to create a "MillingProject" as if you wanted to drill through these points.

Example:
path_settings = RDK.AddMillingProject("AutoPointFollow settings")
prog, status = path_settings.setMillingParameters(part=object_points)
At this point, we may have to manually adjust the tool object or the reference frame if the robot can't follow the path.

Finally, we can simulate the create program if success:
prog.RunProgram()

You will find a sample macro attached that shows other ways of making the robot move along a list of points.


Attached Files
.py MoveRobotThroughLine.py(Size: 10.56 KB / Downloads: 1,812)




Users browsing this thread:
1 Guest(s)