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: 

Sort by name tools

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
rob_carri
663 Views, 5 Replies

Sort by name tools

good morning everyone

At the end of the race always messed up.

Is there any macro that you order me the tools by the name found?

greetings and thanks

 

21.PNG

5 REPLIES 5
Message 2 of 6
5axes
in reply to: rob_carri

FOREACH tl IN reverse(sort(folder('tool'),'name')) {
   ORDERSESSION Tool $tl.name FIRST
}
Message 3 of 6
rob_carri
in reply to: 5axes

great thank you very much

Message 4 of 6
iamcdn79
in reply to: 5axes

Can you do 2 different sorting options? One by tool name and the other by tool diameter?

 

I tried 

 

FOREACH tl IN (sort(folder('tool'),'name')) {
FOREACH tl IN (sort(folder('tool'),'diameter')) {
ORDERSESSION Tool $tl.name FIRST
}

 but didn't work


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

Message 5 of 6
5axes
in reply to: iamcdn79

Yes but in two times.

// First sorting operation on the second option (name)
FOREACH tl IN (sort(folder('tool'),'name')) {
ORDERSESSION Tool $tl.name FIRST
}
// Second sorting operation on the main criteria ( diameter)
FOREACH tl IN (sort(folder('tool'),'diameter')) {
ORDERSESSION Tool $tl.name FIRST
}

or perhaps something like :

 

FOREACH tl IN (sort(sort(folder('tool'),'name'),'diameter')) {
ORDERSESSION Tool $tl.name FIRST
}

 

but not tested

 

Message 6 of 6
5axes
in reply to: 5axes

tested 

FOREACH tl IN reverse(sort(sort(folder('tool'),'name'),'diameter')) {
ORDERSESSION Tool $tl.name FIRST
}

using reverse to get a sorting result with tool from the minimal radius to the maximal and with an alphabetic order.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report