<?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: Re :  function extract problem in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11491684#M31386</link>
    <description>&lt;P&gt;For a lot of things, I recommend contacting Autodesk support. If you want to Autodesk improve macro you must create a case in the support. In my opinion, the macro language had a really short life of development if assuming Autodesk did only a little development.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1.&amp;amp;2. All parameters are in Documentation -&amp;gt; Parameters -&amp;gt; Reference. This is the primary source of information. There are also all available functions.&lt;/LI&gt;&lt;LI&gt;3. I think it is not possible. Ask Autodesk support or create a case in the Autodesk support that you would like it to implement.&lt;/LI&gt;&lt;LI&gt;4. At all your defined variables. At Powermill parameters and functions, it is not necessary, but I am using them there because when you need to just print out a function or parameter in the command line you must have that there. Also, the macro language is forgiving when you omit it in some spots. Both macros below work:&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;INT LIST $toolsNumbers = $extract($folder('Tool'), 'Number.Value')

INT $dummy = $remove_duplicates($toolsNumbers)

FOREACH $toolNumber IN $toolsNumbers {

	REAL $cuttingTimeSum = 0

	FOREACH $tp IN $folder("Toolpath") {
	
		IF $tp.Tool.Number.Value == $toolNumber {
		
			$cuttingTimeSum = $cuttingTimeSum + $tp.Statistics.TotalTime
		}
	}
	
	PRINT ${"Tool Number: " + $toolNumber + " Total Time: " + $time_to_string($cuttingTimeSum)}

}​&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;INT LIST toolsNumbers = extract(folder('Tool'), 'Number.Value')

INT dummy = remove_duplicates(toolsNumbers)

FOREACH toolNumber IN toolsNumbers {

	REAL cuttingTimeSum = 0

	FOREACH tp IN folder("Toolpath") {
	
		IF tp.Tool.Number.Value == toolNumber {
		
			$cuttingTimeSum = $cuttingTimeSum + tp.Statistics.TotalTime
		}
	}
	
	PRINT ${"Tool Number: " + toolNumber + " Total Time: " + time_to_string(cuttingTimeSum)}

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Type HELP in the command line. You will get a list of available commands. Then type HELP CREATE and you will get all available commands after the command CREATE. Then type HELP CREATE TOOLPATH and you got nothing. So you can't create a toolpath with this command. Type HELP CREATE BOUNDARY and it's alright. Type&amp;nbsp;HELP CREATE BOUNDARY ; and you will get all available commands when the ";" is a placeholder for the name of a boundary. So you can use CREATE BOUNDARY ; SILHOUETTE or CREATE BOUNDARY "HelloName" SILHOUETTE&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Tue, 18 Oct 2022 20:28:12 GMT</pubDate>
    <dc:creator>ondrej.mikulec</dc:creator>
    <dc:date>2022-10-18T20:28:12Z</dc:date>
    <item>
      <title>Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605484#M31370</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking to make some macros so that we can automatically generate toolpaths for our more commonly used strategies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I've got is that when I run the macro, unless the toolpath number automatically generated is the same as the one generated when I wrote the macro, it won't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The macro line in question is - RENAME TOOLPATH "1" "EM8 MAC rough"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where "1" is the automatically generated toolpath name and "EM8 MAC rough" is whatever the name of that particular strategy is called.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is when there has already been a toolpath generated with the name "1". Even if it has subsequently been renamed, running the macro gives an error message along the lines of TOOLPATH 1 ALREADY EXISTS. It's trying to rewrite toolpath 1 but the toolpath generated by the macro might be toolpath 2 or 3&amp;nbsp;or so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is to write the macro so that it says something along the lines of &amp;nbsp;- RENAME TOOLPATH "&lt;EM&gt;whatever it is called&lt;/EM&gt;" "EM8 MAC rough"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just don't know the macro code for "&lt;EM&gt;whatever it is called&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure if that makes sense. Sorry, I'm all rather new to macros.....&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 13:20:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605484#M31370</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-06T13:20:33Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605517#M31371</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is for sure a solution, but could you please provide two screenshots "before-after" to better explain what you want to do ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Olivier&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 13:31:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605517#M31371</guid>
      <dc:creator>NanchenO</dc:creator>
      <dc:date>2016-10-06T13:31:25Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605630#M31372</link>
      <description>&lt;P&gt;RENAME TOOLPATH "&lt;EM&gt;whatever it is called&lt;/EM&gt;" "EM8 MAC rough" -&amp;gt; Whatever is called could be replace by &lt;STRONG&gt;$Toolpath&lt;/STRONG&gt; ...&amp;nbsp; just after the new toolpath creation this one is still active. So it could be identify with the variable &lt;STRONG&gt;$Toolpath&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution : RENAME TOOLPATH&amp;nbsp;&lt;STRONG&gt;$Toolpath &lt;/STRONG&gt;"EM8 MAC rough"&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 14:09:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605630#M31372</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2016-10-06T14:09:27Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605675#M31373</link>
      <description>&lt;P&gt;Cheers Guys.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That $Toolpath code worked a treat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd taken a look thorough the "guide to writing macros" and noticed the $ commands, but it all looked a little confusing. Some good bedtime reading...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rich.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 14:21:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605675#M31373</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-06T14:21:01Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605683#M31374</link>
      <description>&lt;P&gt;This would also be an alternative wouldn't it be?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;RENAME TOOLPATH ; "EM8 MAC rough"&lt;/PRE&gt;&lt;P&gt;They both rename an active toolpath&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 14:23:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6605683#M31374</guid>
      <dc:creator>iamcdn79</dc:creator>
      <dc:date>2016-10-06T14:23:33Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6606569#M31375</link>
      <description>&lt;P&gt;The Macro langage is very rich, that's a strength and also sometimes a problem because it could be confusing :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so you can use :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RENAME TOOLPATH&amp;nbsp; $Toolpath&amp;nbsp;"EM8 MAC rough"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RENAME TOOLPATH # "EM8 MAC rough"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RENAME TOOLPATH&amp;nbsp;; "EM8 MAC rough"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RENAME TOOLPATH $ENTITY('toolpath','') "EM8 MAC rough"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can also use a function like new_entity_name to get the name of the next toolpath created.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING $TpName = new_entity_name('toolpath')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RENAME TOOLPATH&amp;nbsp;&amp;nbsp;$TpName "EM8 MAC rough"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is always differents way to reach the same goal&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 19:56:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6606569#M31375</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2016-10-06T19:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6606597#M31376</link>
      <description>&lt;P&gt;If you're ever stuck for a macro command, providing you know how to do what you want, you can use the &lt;U&gt;Echo Commands&lt;/U&gt; tool.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the &lt;STRONG&gt;Menu Bar&lt;/STRONG&gt; click &lt;STRONG&gt;Tools&lt;/STRONG&gt; then &lt;STRONG&gt;Echo Commands&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Command window will open at the bottom of your screen, then every time you click a button or change a setting in PowerMILL the command line will be shown in the bottom window. Simply copy the line and paste it into your macro, then edit as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a great tool, even after years of writing macros I still use it regularly (especially when the developers change the language or command &lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://forums.autodesk.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt; )&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2016 20:08:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6606597#M31376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-06T20:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6607549#M31377</link>
      <description>The guy who did our training on Pmill went through that.&lt;BR /&gt;&lt;BR /&gt;The issue in this case is that echoing commands would only bring up the&lt;BR /&gt;specific toolpath number which was generated, not a term for generic tool&lt;BR /&gt;numbers.&lt;BR /&gt;&lt;BR /&gt;all sorted now though.&lt;BR /&gt;&lt;BR /&gt;Thanks folks.&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;------------------------------------------------------------------------------------------&lt;BR /&gt;This email and any files transmitted with it are confidential and&lt;BR /&gt;intended solely for the use of the individual or entity to whom they are&lt;BR /&gt;addressed.&lt;BR /&gt;&lt;BR /&gt;Information or opinions in this email which do not relate to the&lt;BR /&gt;official business of Allies and Morrison are neither given nor endorsed by&lt;BR /&gt;it.&lt;BR /&gt;&lt;BR /&gt;If you have received this email in error please notify&lt;BR /&gt;*studio@alliesandmorrison.com *&lt;BR /&gt;Allies and Morrison LLP (OC404597) is a Limited Liability&lt;BR /&gt;Partnership incorporated in England and Wales whose registered office is 85&lt;BR /&gt;Southwark Street, SE1 0HX&lt;BR /&gt;------------------------------------------------------------&lt;BR /&gt;------------------------------</description>
      <pubDate>Fri, 07 Oct 2016 08:38:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6607549#M31377</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-10-07T08:38:55Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6609721#M31378</link>
      <description>&lt;P&gt;there are 10 toolpaths, and I want change the toolpath name to "toolname+holdername+thickness"&amp;nbsp; one by one .&lt;/P&gt;&lt;P&gt;how can we do by macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2016 05:12:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6609721#M31378</guid>
      <dc:creator>yanbin.liuTE8KH</dc:creator>
      <dc:date>2016-10-08T05:12:48Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6611810#M31379</link>
      <description>&lt;P&gt;something like :&lt;/P&gt;&lt;PRE&gt;// Rename every toolpath
STRING NewName = ''
FOREACH ent IN folder('Toolpath') {
    ACTIVATE TOOLPATH $ent
    
    $NewName= $ent.tool.name + "-" + $ent.tool.HolderName + "-"  + $ent.Thickness
    // test if the Name is already valid if not true nothing to do 
    if $ent.Name != $NewName {
	    // test if toolpath name already exist
	    if entity_exists('toolpath', $NewName) {
	        // Give the next valid toolpath name
	    	$NewName = new_entity_name('toolpath', $NewName)
	    }
	    RENAME TOOLPATH $ent.name $NewName
    }
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Oct 2016 09:51:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6611810#M31379</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2016-10-10T09:51:27Z</dc:date>
    </item>
    <item>
      <title>Re : Macro for generating toolpaths</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6612016#M31380</link>
      <description>thanks</description>
      <pubDate>Mon, 10 Oct 2016 12:05:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/6612016#M31380</guid>
      <dc:creator>yanbin.liuTE8KH</dc:creator>
      <dc:date>2016-10-10T12:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Re :  function extract problem</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11456076#M31381</link>
      <description>&lt;P&gt;I am learning Powermill macro. Very bad description.There is no good description, and the information is not structured and there is no integrity.Therefore, questions arise. Perhaps you can answer some. We have a function extract (list, par_name) returns a list of parameter values ​​(par_name) extracted from the list (list) of the input list. It says so in the description. Let's take several different parameters with different data types in essence the toolpath.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 Parameter "Batch" bool type. Get a list of bool type parameter values.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;bool list m = extract(folder('toolpath'),'Batch')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_0-1664640480186.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122471i2043606F43A2DA41/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_0-1664640480186.png" alt="vasilevich555_0-1664640480186.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Parameter "Revision" type int. Get a list of parameter values ​​of type int.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;int list m = extract(folder('toolpath'),'Revision')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_1-1664640515314.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122472i420B73969086CEAC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_1-1664640515314.png" alt="vasilevich555_1-1664640515314.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_2-1664640529392.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122473i6A16BC674B2551A5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_2-1664640529392.png" alt="vasilevich555_2-1664640529392.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Parameter "Block.Limits.Xmax" type real. Get a list of values ​​of the real type parameter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;real list m = extract(folder('toolpath'),'Block.Limits.Xmax')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_3-1664640568303.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122474i87787442334D5F6D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_3-1664640568303.png" alt="vasilevich555_3-1664640568303.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_4-1664640603074.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122475i2CCB73425D443176/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_4-1664640603074.png" alt="vasilevich555_4-1664640603074.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;4. &lt;SPAN&gt;The "Stepover" parameter is of type real. We get an empty list of parameter values.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; What does it mean???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;real list m = extract(folder('toolpath'),'Stepover')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_5-1664640656660.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122476iC914E7B7B79E853D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_5-1664640656660.png" alt="vasilevich555_5-1664640656660.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_6-1664640668850.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122477iC2458AD4926FCEC7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_6-1664640668850.png" alt="vasilevich555_6-1664640668850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5. &amp;nbsp;Parameter Type of object "Coolant". Get a list of object values.&lt;/SPAN&gt;object list m = extract(folder('toolpath'),'Coolant')&lt;SPAN&gt;Why is MAP shown for debugging and not object ???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_7-1664640710125.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122479iA25C73E11E30779D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_7-1664640710125.png" alt="vasilevich555_7-1664640710125.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_8-1664640722257.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122480i971CC1E9029239C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_8-1664640722257.png" alt="vasilevich555_8-1664640722257.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;6.&amp;nbsp; Parameter "Strategy" type ENUM. Powermill gives an error. &lt;/SPAN&gt;&lt;SPAN&gt;F&lt;/SPAN&gt;&lt;SPAN&gt;or both cases.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;What is wrong here?&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;string list m = extract(folder('toolpath'),'Strategy')&lt;/P&gt;&lt;P&gt;enum list m = extract(folder('toolpath'),'Strategy')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_9-1664640799999.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122481i5512A6ECFD408500/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_9-1664640799999.png" alt="vasilevich555_9-1664640799999.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_10-1664640816569.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1122482iE2796F10BED93DED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_10-1664640816569.png" alt="vasilevich555_10-1664640816569.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 16:19:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11456076#M31381</guid>
      <dc:creator>vasilevich555</dc:creator>
      <dc:date>2022-10-01T16:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Re :  function extract problem</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11456379#M31382</link>
      <description>&lt;P&gt;I don't see so much benefit in using the Extract() function in macros. I am using the Extract() function in my applications where there is a significant bottleneck between the app and Powermill.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;real list m = extract(folder('toolpath'),'Stepover')&lt;/SPAN&gt;&lt;BR /&gt;Works well in my macro/computer. But to properly test try printing the result in the command line. Just type in the command line:&amp;nbsp;&lt;BR /&gt;print par "extract(folder('toolpath'),'Stepover')"&lt;BR /&gt;&lt;BR /&gt;Instead of the 'Coolant' use 'Coolant.Value'.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'Strategy' doesn't work in my macro/computer either. But printing value is alright&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;print par "extract(folder('toolpath'),'Strategy')" &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;so I can't help with that. Some other ENUM values work alright. So maybe a Powermill bug?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Oct 2022 00:54:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11456379#M31382</guid>
      <dc:creator>ondrej.mikulec</dc:creator>
      <dc:date>2022-10-02T00:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re :  function extract problem</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11485032#M31383</link>
      <description>&lt;P&gt;&lt;SPAN&gt;If you use the print par ${extract ()} command, then all types work&lt;/SPAN&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;SPAN&gt;This command gives an array of the same type as specified in the entity structure.&lt;/SPAN&gt; &lt;SPAN&gt;For types &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;string, bool, int, real it will be array m[] = $extract().&lt;/SPAN&gt; &lt;SPAN&gt;The type object would be list = $extract()&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Questions remain on some types. For example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1. T&lt;SPAN&gt;ype&lt;/SPAN&gt; real array&lt;/P&gt;&lt;P&gt;print par ${extract(folder('TOOLPATH'),'EndPoint.Position')}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_0-1665851192341.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1127844i936AB6ED627B7A5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_0-1665851192341.png" alt="vasilevich555_0-1665851192341.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2 T&lt;SPAN&gt;ype&lt;/SPAN&gt; enum&lt;/P&gt;&lt;P&gt;print par ${extract(folder('TOOLPATH'),' Strategy')}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_1-1665851266962.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1127845i247CFBF242F50912/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_1-1665851266962.png" alt="vasilevich555_1-1665851266962.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What should be written on the left side of the expression to get these arrays or lists?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;??? = $extract(folder('TOOLPATH'),'EndPoint.Position')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;??? = $extract(folder('TOOLPATH'),'Strategy')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3 &lt;/SPAN&gt;&lt;SPAN&gt;You also specify what can be used Instead of "Coolant", use "Coolant.Value". I don't understand what exactly you mean?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 16:31:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11485032#M31383</guid>
      <dc:creator>vasilevich555</dc:creator>
      <dc:date>2022-10-15T16:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re :  function extract problem</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11485280#M31384</link>
      <description>&lt;P&gt;&lt;SPAN&gt;REAL LIST $extractedX = $extract(folder('TOOLPATH'),'EndPoint.Position.X')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;REAL LIST $extractedY = $extract(folder('TOOLPATH'),'EndPoint.Position.Y')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;REAL LIST $extractedZ = $extract(folder('TOOLPATH'),'EndPoint.Position.Z')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;REAL LIST $extractedX = $extract(folder('TOOLPATH'),'EndPoint.Position[0]')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;REAL LIST $extractedY = $extract(folder('TOOLPATH'),'EndPoint.Position[1]')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;REAL LIST $extractedZ = $extract(folder('TOOLPATH'),'EndPoint.Position[2]')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the same as with "Coolant" and "Coolant.Value". When you are attempting to extract the "Coolant" the extracted output cannot be cast into the STRING list, because "Coolant" properties are not of the string type. The "Coolant" is maybe a class that has the property "Value" inside which is correctly returning the string castable value.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;The "EndPoint.Position" is an array. So it cannot be cast into the REAL LIST. Theoretically, you would need something as "List&amp;lt;double[]&amp;gt;" but I'm not sure that Powermill macro is capable of doing that. You have to extract the final values of the array which are indexed. I have also tried X, Y, and Z, and it's working.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Why the “Strategy” doesn’t work? I don't know. I would just use the FOREACH loop to fill a list anyway.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The “extract” method is tricky because the extracted list skips toolpaths that have not implemented the extracting property. So therefore the array indexes of the extracted values don’t match. I am extracting via “print par” which is also returning [0], [1], [2], …. Next to extracted values so I have correct indexes. But I am not using that in standard Powermill macros, only in .NET applications with really big Powermill projects with a lot of entities.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Oct 2022 21:12:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11485280#M31384</guid>
      <dc:creator>ondrej.mikulec</dc:creator>
      <dc:date>2022-10-15T21:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Re :  function extract problem</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11490192#M31385</link>
      <description>&lt;P&gt;&lt;SPAN&gt;It seems that the macro language in powermill is poorly designed, lacking clear logic and lacking repeatability with different data types. print par&lt;/SPAN&gt; &lt;SPAN&gt;{} command&lt;/SPAN&gt; &lt;SPAN&gt;gives the same, clear and simple representation, the extract() function is absolutely not up to it. Probably, there is a degradation of developers and therefore the lack of a common concept. Probably, there is no selection of developers by psychotypes. I would replace the one who manages the development. Some kind of chaos in general in powermill, not only in macros, they do what they want, but not what they need.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here a number of questions arise.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;If print par{} works well, is it possible to use this command to get data? I did not find her description of the instructions.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;REAL LIST $extractedX = $extract(folder('TOOLPATH'),'EndPoint.Position.&lt;U&gt;X&lt;/U&gt;').&amp;nbsp;&lt;SPAN&gt;The fields X,Y,Z are not present in the entity.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_0-1666091844983.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1128678iB07EC8C52704718B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_0-1666091844983.png" alt="vasilevich555_0-1666091844983.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Also in the example&lt;/SPAN&gt; STRING LIST names = extract(folder('toolpath'),'name') - there is no &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'&lt;U&gt;name&lt;/U&gt;' field in the object structure. Where can I find a description of all fields?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_1-1666091940993.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1128679i3CF4DBCFFFABB654/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_1-1666091940993.png" alt="vasilevich555_1-1666091940993.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. It is not clear how to define an array, where are two sizes? For example an array&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vasilevich555_2-1666091987459.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1128680i466F8AB183933289/image-size/medium?v=v2&amp;amp;px=400" role="button" title="vasilevich555_2-1666091987459.png" alt="vasilevich555_2-1666091987459.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How to set such an array for example for a real array[ ][ ] = ???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. It is not clear in which cases the use of $ is necessary, and in some cases it is not,&lt;/P&gt;&lt;P&gt;especially if it is an expression. I haven't found any universal rule. This language construct is not understood. Can you explain this to me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;5. &lt;/SPAN&gt;There is another question on another topic. It is not clear where you can find a description of the command with their parameters. For example, the instruction contains a command to create a toolpath. &lt;SPAN&gt;An example is given in the instructions section &lt;/SPAN&gt;&lt;SPAN&gt;“ &lt;/SPAN&gt;Sorted list&lt;SPAN&gt;”.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CREATE TOOLPATH 'bbb' RASTER - This command doesn't work&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;In echo, the creation of a trajectory looks like a set of other commands. Where can I get a&amp;nbsp; &amp;nbsp; &amp;nbsp;description of the commands and a description of their parameters?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 11:23:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11490192#M31385</guid>
      <dc:creator>vasilevich555</dc:creator>
      <dc:date>2022-10-18T11:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re :  function extract problem</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11491684#M31386</link>
      <description>&lt;P&gt;For a lot of things, I recommend contacting Autodesk support. If you want to Autodesk improve macro you must create a case in the support. In my opinion, the macro language had a really short life of development if assuming Autodesk did only a little development.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1.&amp;amp;2. All parameters are in Documentation -&amp;gt; Parameters -&amp;gt; Reference. This is the primary source of information. There are also all available functions.&lt;/LI&gt;&lt;LI&gt;3. I think it is not possible. Ask Autodesk support or create a case in the Autodesk support that you would like it to implement.&lt;/LI&gt;&lt;LI&gt;4. At all your defined variables. At Powermill parameters and functions, it is not necessary, but I am using them there because when you need to just print out a function or parameter in the command line you must have that there. Also, the macro language is forgiving when you omit it in some spots. Both macros below work:&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;INT LIST $toolsNumbers = $extract($folder('Tool'), 'Number.Value')

INT $dummy = $remove_duplicates($toolsNumbers)

FOREACH $toolNumber IN $toolsNumbers {

	REAL $cuttingTimeSum = 0

	FOREACH $tp IN $folder("Toolpath") {
	
		IF $tp.Tool.Number.Value == $toolNumber {
		
			$cuttingTimeSum = $cuttingTimeSum + $tp.Statistics.TotalTime
		}
	}
	
	PRINT ${"Tool Number: " + $toolNumber + " Total Time: " + $time_to_string($cuttingTimeSum)}

}​&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;INT LIST toolsNumbers = extract(folder('Tool'), 'Number.Value')

INT dummy = remove_duplicates(toolsNumbers)

FOREACH toolNumber IN toolsNumbers {

	REAL cuttingTimeSum = 0

	FOREACH tp IN folder("Toolpath") {
	
		IF tp.Tool.Number.Value == toolNumber {
		
			$cuttingTimeSum = $cuttingTimeSum + tp.Statistics.TotalTime
		}
	}
	
	PRINT ${"Tool Number: " + toolNumber + " Total Time: " + time_to_string(cuttingTimeSum)}

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Type HELP in the command line. You will get a list of available commands. Then type HELP CREATE and you will get all available commands after the command CREATE. Then type HELP CREATE TOOLPATH and you got nothing. So you can't create a toolpath with this command. Type HELP CREATE BOUNDARY and it's alright. Type&amp;nbsp;HELP CREATE BOUNDARY ; and you will get all available commands when the ";" is a placeholder for the name of a boundary. So you can use CREATE BOUNDARY ; SILHOUETTE or CREATE BOUNDARY "HelloName" SILHOUETTE&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 18 Oct 2022 20:28:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-generating-toolpaths/m-p/11491684#M31386</guid>
      <dc:creator>ondrej.mikulec</dc:creator>
      <dc:date>2022-10-18T20:28:12Z</dc:date>
    </item>
  </channel>
</rss>

