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: 

Macro for total calculation time of a project

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
707 Views, 4 Replies

Macro for total calculation time of a project

Hi,
is there a macro that shows the calculation time of the entire project or a folder with multiple toolpath?
4 REPLIES 4
Message 2 of 5
kevin.hammond3WX4X
in reply to: Anonymous

Hi,

I use this...

 

string time = ""
string msg = "select toolpaths for Time statistics"
ENTITY LIST Toolpath = INPUT ENTITY MULTIPLE Toolpath $msg
CREATE NCPROGRAM ; EDIT NCPROGRAM ; QUIT FORM NCTOOLPATH
NCTOOLPATH CANCEL FORM ACCEPT NCTOOLPATHLIST FORM ACCEPT NCTOOLLIST FORM ACCEPT PROBINGNCOPTS

FOREACH tp IN Toolpath {
//EDIT NCPROGRAM ; APPEND TOOLPATH $tp.name
EDIT NCPROGRAM # INSERT Toolpath $tp.name LAST
}
EDIT STATISTICS NCPROGRAM ; FORM STATISTICS
$time = $widget('Statistics.Time').value
Message info "Time for Selected PGMs is " + $time
DELETE NCPROGRAM #
FORM CANCEL STATISTICS

 

 

Have attached macro below, save and rename from .txt to .mac

Message 3 of 5
Anonymous
in reply to: kevin.hammond3WX4X

Thanks for the response and this usefull macro.

but what i need is a macro which shows me the time to calculate the toolpath of the whole project.

 

it wolud be perfect if the macro start the time, run a folder wtih uncalculated toolpath and shows me  at the end a message with the complete time of calculation.

Message 4 of 5
rui_rita
in reply to: Anonymous

Hi,

 

this will run throu all toolpaths:

 

STRING $msg = ""
INT $start_time = 0
INT $tp_time = 0
INT $final_time = 0
INT $count = 0

INFOBOX NEW "Batch Time Process"
INFOBOX STYLE "NORMAL"
foreach $tp in FOLDER ('toolpath') {
$msg = " TOOLPATH: '" + $tp.Name +"' ->"
INFOBOX APPEND $msg
if not ( $tp.Computed) {
if ($tp.batch == 0) {
$msg = " Batch Process Off " + CRLF
} else {
DIALOGS MESSAGE OFF
DIALOGS ERROR OFF
ACTIVATE TOOLPATH $tp.name
$start_time = time()
EDIT TOOLPATH $tp.Name CALCULATE
$tp_time = time() - $start_time
if not ( $tp.Computed) {
$msg = " Could not Calculate!!!" + CRLF
} else {
$msg = " " + $time_to_string($tp_time ,"S") + CRLF
$final_time = $final_time + $tp_time
$count = $count + 1
}
}
} else {
$msg = " Already Calculated" + CRLF
}
DIALOGS MESSAGE ON
INFOBOX APPEND $msg
}
DIALOGS MESSAGE ON
DIALOGS ERROR ON
$msg = " Total Time for " + $count + " toolpaths: "+ time_to_string($final_time ,"S") + CRLF
INFOBOX APPEND $msg



Os melhores cumprimentos | Best regards
Rui Rita
________________________________
NEWCAM, Lda.
Message 5 of 5
Anonymous
in reply to: rui_rita

This is exactly what I was looking for.

 

Thank you!

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

Post to forums  

Autodesk Design & Make Report