Access points from an item——革命制度党ntable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) + - - -论坛:通用RoboDK问题(//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK) +--- Thread: Access points from an item (/Thread-Access-points-from-an-item) |
Access points from an item-Tobias7-01-11-2017 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. RE: Access points from an item-RoboDK-04-09-2017 It is currently not possible to extract the points from an object. Something you cando insteadis to save it as a station parameter withgetParam/setParam: RDK.setParam('POINTS', str(POINTS)) Station parameters are saved together with the RDK file as strings. Then, you can retrieve the list back: 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. |