Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

access to start point and end point of segments

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Vasago
1383 Views, 8 Replies

access to start point and end point of segments

I need to rescue the start point and end point data from all the segments of a toolpath.

 

Sin título.jpg

8 REPLIES 8
Message 2 of 9
5axes
in reply to: Vasago

to rescue ?
Message 3 of 9
Vasago
in reply to: 5axes

.... Get value....

Message 4 of 9
5axes
in reply to: Vasago

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

 

Tags (1)
Message 5 of 9
Vasago
in reply to: 5axes

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?

Message 6 of 9
5axes
in reply to: Vasago

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,

Message 7 of 9
Vasago
in reply to: 5axes

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.

Message 8 of 9
5axes
in reply to: Vasago

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.

 

Pic.jpg

 

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

 

 

Message 9 of 9
a_bako
in reply to: Vasago

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.

Post to forums  

Autodesk Design & Make Report