<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [MACRO] Total machining Time in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162115#M26923</link>
    <description>&lt;P&gt;I know it's not what you asked for, but here is what I use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;INT(entity('toolpath';'').statistics.LeadsandLinks.Times.plunge + entity('toolpath';'').statistics.LeadsandLinks.Times.ramp + entity('toolpath';'').statistics.LeadsandLinks.Times.rapid + entity('toolpath';'').statistics.LeadsandLinks.Times.others + entity('toolpath';'').statistics.cuttingmoves.Times.arcs + entity('toolpath';'').statistics.cuttingmoves.Times.linear)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not simple, and not one command, but it seems to work. &amp;nbsp;I have this in my user defined field a the bottom of the screen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2017 16:01:22 GMT</pubDate>
    <dc:creator>stdpattern</dc:creator>
    <dc:date>2017-06-19T16:01:22Z</dc:date>
    <item>
      <title>[MACRO] Total machining Time</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162047#M26922</link>
      <description>&lt;P&gt;Hello Guys!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if there is any command that gives me the total time of machining. I know i can add the partial times ( cutting, links...) and then get the total time but for me me it would be way more easy to do have a simple command that gives me the total time of machining.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;José Miguel Alves&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 15:46:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162047#M26922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-19T15:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Total machining Time</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162115#M26923</link>
      <description>&lt;P&gt;I know it's not what you asked for, but here is what I use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;INT(entity('toolpath';'').statistics.LeadsandLinks.Times.plunge + entity('toolpath';'').statistics.LeadsandLinks.Times.ramp + entity('toolpath';'').statistics.LeadsandLinks.Times.rapid + entity('toolpath';'').statistics.LeadsandLinks.Times.others + entity('toolpath';'').statistics.cuttingmoves.Times.arcs + entity('toolpath';'').statistics.cuttingmoves.Times.linear)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not simple, and not one command, but it seems to work. &amp;nbsp;I have this in my user defined field a the bottom of the screen.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 16:01:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162115#M26923</guid>
      <dc:creator>stdpattern</dc:creator>
      <dc:date>2017-06-19T16:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Total machining Time</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162210#M26924</link>
      <description>&lt;P&gt;This is what I use for all toolpaths or an active folder. to do all of them, change ($folderName) to ('Toolpath') the 1.9 is a fudge factor for my actual machine time. thatll need to be changed&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;GRAPHICS LOCK
STRING folderName = active_folder()
REAL i = 0
FOREACH $tp IN FOLDER ($folderName) {
	ACTIVATE TOOLPATH $tp.name
	REAL nonCutting = $tp.Statistics.LeadsAndLinks.Times.Others + $tp.Statistics.LeadsAndLinks.Times.Plunge + $tp.Statistics.LeadsAndLinks.Times.Ramp + $tp.Statistics.LeadsAndLinks.Times.Rapid 
	REAL cutting = $tp.Statistics.CuttingMoves.Times.Arcs + $tp.Statistics.CuttingMoves.Times.Linear
	REAL totalTime = (($nonCutting + $cutting) * 1.9) / 60
	$i = $i + $totalTime
}
GRAPHICS UNLOCK

MESSAGE INFO "Approximate Cutting Time Is: " + CRLF + CRLF + ROUND($i, 2) + " Hours"&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Jun 2017 16:26:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162210#M26924</guid>
      <dc:creator>TK.421</dc:creator>
      <dc:date>2017-06-19T16:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Total machining Time</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162581#M26925</link>
      <description>&lt;P&gt;Same solution as &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3976796"&gt;@TK.421&lt;/a&gt;&amp;nbsp;for me. I don't think we can have directly the totaltimes , So I use a macro and Store the result in two session variables. ( One for the Folder and one for the result) . Like that this result can be show in a personnal toolbar which is positionned just on the top of the Explorer treeView.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;// Total times Calculation + Store in a $Session Variable :TotalTime
// Store in a $Session Variable :CFolder
REAL $total_time = 0

// Session Variable to store the result
If NOT member($session._keys, "TotalTime") {
		      SESSIONPAR REAL TotalTime = 0
		   }
If NOT member($session._keys, "CFolder") {
		      SESSIONPAR STRING CFolder = "Toolpath"
		   }

// Active Folder
//get the active folder (if there is one)
STRING $a_f = active_folder()

//fix the folder to the toolpaths roots if there is no active folder
IF $a_f == '' {
  $a_f = "Toolpath"
}

//fix the folder to analyse to toolpath roots if the active folder is not in the toolpath mode
STRING LIST $Split = {}
$Split = TOKENS($a_f, "\")

IF $Split[0] != "Toolpath" {
  $a_f = "Toolpath"
}
		   
FOREACH tpath IN folder($a_f) {
	$total_time = total_time + $tpath.statistics.leadsandlinks.times.rapid
	$total_time = total_time + $tpath.statistics.leadsandlinks.times.plunge
	$total_time = total_time + $tpath.statistics.leadsandlinks.times.ramp
	$total_time = total_time + $tpath.statistics.leadsandlinks.times.others
	$total_time = total_time + $tpath.statistics.cuttingmoves.times.linear
	$total_time = total_time + $tpath.statistics.cuttingmoves.times.arcs
}

$session.TotalTime = round($total_time,2)
$session.CFolder = $a_f
STRING $msg =  string(round($total_time,2))
//MESSAGE INFO "Total Time $a_f : $Msg mn"&lt;/PRE&gt;
&lt;P&gt;hereafter a view of the personal toolbar with the result :&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Toolbar.jpg" style="width: 308px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/368904i3DF0FC183CD3E888/image-size/large?v=v2&amp;amp;px=999" role="button" title="Toolbar.jpg" alt="Toolbar.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And the Toolbar customization :&lt;/P&gt;
&lt;P&gt;One button to call the macro &amp;nbsp;&lt;/P&gt;
&lt;P&gt;And two fileds to display the result , one for the active Folder, the other one for the total calculation times in minutes&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CustomTbar.jpg" style="width: 536px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/368918iA0CD9A9BC111F1AE/image-size/large?v=v2&amp;amp;px=999" role="button" title="CustomTbar.jpg" alt="CustomTbar.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 18:33:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162581#M26925</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2017-06-19T18:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Total machining Time</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162616#M26926</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3969139"&gt;@5axes&lt;/a&gt; Do you need to run your macro every time you want to update the info in the status bar?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 18:26:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162616#M26926</guid>
      <dc:creator>TK.421</dc:creator>
      <dc:date>2017-06-19T18:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Total machining Time</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162666#M26927</link>
      <description>&lt;P&gt;Yes&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3976796"&gt;@TK.421&lt;/a&gt;&amp;nbsp; These variables must be updated &amp;nbsp;manualy, tht's why in the toolbar the first button is a shortcut to the calculation macro. I haven't find a solution to update the data automaticaly ( and in reallity I don't need to get &amp;nbsp;these informations always up to date )&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 18:40:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162666#M26927</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2017-06-19T18:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: [MACRO] Total machining Time</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162787#M26928</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3969139"&gt;@5axes&lt;/a&gt;: I'm going to add your macro to my "from forum" collection! Thanks for sharing that!!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2017 19:18:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-total-machining-time/m-p/7162787#M26928</guid>
      <dc:creator>TK.421</dc:creator>
      <dc:date>2017-06-19T19:18:58Z</dc:date>
    </item>
  </channel>
</rss>

