I need to rescue the start point and end point data from all the segments of a toolpath.
Solved! Go to Solution.
Solved by Vasago. Go to Solution.
You can get the values of the start and endpoint of a toolpath via the variables :
REAL ARRAY $Start_Point[3] = $entity('toolpath','').startpoint.position
REAL ARRAY $End_Point[3] = $entity('toolpath','').endpoint.position
But to get the start point and end point of every segment , you need to split the toolpath into individual toolpaths via the command :
EDIT TOOLPATH DIVIDE TYPE RETRACT
PROCESS TPDIVIDE YES
And get the datas for every new created toolpaths. Then delete these useless toolpaths.
More informations on the Old Delcam Forum :
https://manufacturing.autodesk.com/forums/forum.delcam.com/viewtopic260a.html?p=57948#p57948
And also the original code of @craig.chester
https://manufacturing.autodesk.com/forums/forum.delcam.com/viewtopic0720.html?p=48786#p48786
My problem is that the toolpath I'm going to work with has 3304 segments, imagine creating 3304 toolpaths ... do you know some easier way to get the start and end points without dividing the toolpaths?
You don't have to create 3304 Toolpaths, The code EDIT TOOLPATH DIVIDE TYPE RETRACT will create for you based on your original toolpath. After that your macro will get the start and and point for every segments and then delete the useless toolpath. But Yes if you have a lot of segment this type of macro could be Time consuming.
Regards,
In the end I have used the Autodesk automation libraries, I have inserted the path in a pattern, and I have exported the pattern to PIC file, then I have opened it as List <Polyline> and thus I have obtained all the objects contained within the path. Thank you for spending your time in finding a solution.
Great idea ! But take care, the curves via the Pic format are exported in the global plane. And it could be different from your toolpath Axis system.
So on my point of view you need to transform the pattern into the global plane before to export the pattern.
MODE GEOMETRY_TRANSFORM TOWORLD
object segment_get_point( entity toolpath, int n, int i)
Provides information on the i'th point of the n'th segment of the specified toolpath. It returns a map containing the following fields:
array Position
The position of the point in x,y and z, relative to the toolpath's workplane.
array ToolAxis
The tool axis at this position.
array OrientationVector
The orientation vector at this position. (A zero vector is output when the orientation vector has not been specified.)
Can't find what you're looking for? Ask the community or share your knowledge.