RoboDK Forum
ROBODK Line Follow API in Python: Measure Line length可打印版本

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: ROBODK Line Follow API in Python: Measure Line length (/Thread-ROBODK-Line-Follow-API-in-Python-Measure-Line-length)



ROBODK Line Follow API in Python: Measure Line length-theturdwrangler-02-21-2019

Is there any functionality to get the total length of a curve, or the distance traveled on the curve? For context I'm working on an Automated Fiber Placement project, and it is important to know the total distance traveled before beginning the path for cutting of the tows.


再保险:ROBODK Line Follow API in Python: Measure Line length-Jeremy-02-21-2019

I moved your thread to the API section.


再保险:ROBODK Line Follow API in Python: Measure Line length-Albert-02-25-2019

You can useUpdateon a program to retrieve useful program information, including travelled distance and estimated time. More information here:

So you can do something like:

Code:
from robolink import *
RDK = Robolink()
program = RDK.ItemUserPick('Select a program to get estimated travel distance', ITEM_TYPE_PROGRAM)
if not program.Valid():
quit() # the user cancelled the selection

[n_instructions, program_time, program_distance, valid_ratio, readable_msg] = program.Update()
RDK.ShowMessage('Estimated travel distance is %.1f mm' % program_distance)



再保险:ROBODK Line Follow API in Python: Measure Line length-theturdwrangler-02-25-2019

Thanks, I think this will work