Toolpaths sorted by tolerance

Toolpaths sorted by tolerance

952594517
Explorer Explorer
384 Views
2 Replies
Message 1 of 3

Toolpaths sorted by tolerance

952594517
Explorer
Explorer

Hello everyone I need a mac file that can be sorted by the tolerance of the tool path, tool type, tool diameter, and tool extension length. Tolerance > Tool type (ENDMILL > TIPRADIUSED > BALLNOSED) > Tool diameter > Tool extension length Thank you very much.

0 Likes
385 Views
2 Replies
Replies (2)
Message 2 of 3

icse
Advisor
Advisor

take a look at this:

//gets all toolpaths within the project
entity list $tps = folder('toolpath')

//this sorts the toolpath fields
//add more as you wish
$tps = sort($tps;'Tolerance')
$tps = sort($tps;'Tool.Diameter')

//this 'custom sorts the type'
string list $types = {'end_mill','tip_radiused','ball_nosed'}

entity list $tpsByType = {}

foreach $type in $types {
	foreach $tp in filter($tps;'this.Tool.Type == "${type}"') {		
		int $i = add_last($tpsByType,entity('toolpath';$tp.Name))
	}
}


foreach $tp in $tps {
	if not member($types,$tp.Tool.Type) {
		int $i = add_last($tpsByType,entity('toolpath';$tp.Name))
	}
}

string $msg = join(extract($tpsByType;'name');CRLF)

message info $msg
0 Likes
Message 3 of 3

952594517
Explorer
Explorer

Thank you for your response, but I encountered an error while running the code on line 7.

0 Likes