<?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 for Toolist in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7730942#M23343</link>
    <description>&lt;P&gt;So i've tried replacing the code, but im not quite sure where to put it or what to delete&lt;/P&gt;&lt;P&gt;Am i even close or?&lt;/P&gt;&lt;P&gt;Stops at first ENTITY&amp;nbsp;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes i've also experinced the fault with the tool names, mainly because in my country we use "ÆØÅ" and when changed the tool name in the list it still couldnt save the image, but figured it out like 2 weeks ago&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;STRING $Fold=''
STRING $CFold=''
STRING $Sz="80p" 

// build the expression
STRING $expr = "RootType=='nctoolpath'"
// get the list of tool (sorted in the NCProgram order)
STRING LIST $tl_list = extract(sort(filter(components(entity('ncprogram', $Selected_NCP)), $expr) ,'tool.number') , 'tool.name')
INT Nb=remove_duplicates($tl_list)
/// Liste tous les outils
FOREACH ToolName IN $tl_list {
ENTITY $tp=entity('Tool',$Tl)
        $ToolName = $tp.name
	ENTITY C_Tool = entity('Tool',$ToolName)
	$Fold=dirname(Pathname($C_Tool))
		
	IF $Fold != $CFold {
		// MESSAGE INFO " $Fold   $CFold " 
		$Ligne = "&amp;lt;TR&amp;gt;&amp;lt;TD colspan=10 style='background:#4F81BD'&amp;gt;&amp;lt;H3&amp;gt;"+ $Fold + "&amp;lt;/H3&amp;gt;&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;"
		FILE WRITE $Ligne TO filename
		$CFold=$Fold	
	}
	
	// Depuis les Outils
	$Ligne = "&amp;lt;TR&amp;gt;"
	FILE WRITE $Ligne TO filename
        // Image
        
        $Ligne = "&amp;lt;TD&amp;gt;"
        FILE WRITE $Ligne TO filename
        $Ligne = '&amp;lt;div align="' + 'center"' + '&amp;gt;'
        FILE WRITE $Ligne TO filename
        
        // CREATION IMAGE
	$ModiToolName=REPLACE($ToolName," ","_")
	$ModiToolName=REPLACE($ModiToolName,"/","-") // Corrige les nom outils du type  1/4 Endmill&lt;/PRE&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Marc W&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2018 07:22:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-29T07:22:45Z</dc:date>
    <item>
      <title>Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726349#M23339</link>
      <description>&lt;P&gt;Hello out there&lt;/P&gt;&lt;P&gt;Im currently using this macro for creating a toollist&lt;/P&gt;&lt;P&gt;Its a macro i've found on this forum, cant remember who made it. but i've made some small changes and everything is good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i can't seem to figure out how to get the macro to sort the tools according to the toolnumber, maybe you guys could help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Marc Willumsen&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 14:06:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726349#M23339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-26T14:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726591#M23340</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3969139"&gt;@5axes&lt;/a&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;is the developer of this macro.&lt;/SPAN&gt; Maybe he'll help you with your request.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 15:02:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726591#M23340</guid>
      <dc:creator>rafael.sansao</dc:creator>
      <dc:date>2018-01-26T15:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726592#M23341</link>
      <description>&lt;P&gt;It's me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I already change some lines in this macro due to an issue with&amp;nbsp; &lt;STRONG&gt;FOREACH Tl IN list_nctools(entity('ncprogram', '')) {&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;because&amp;nbsp;&lt;STRONG&gt;list_nctools&lt;/STRONG&gt; returns the ToolId and not the name and if the toolid is diffrent from the tool.name you can have some problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The new code is :&lt;/P&gt;
&lt;PRE&gt;// build the expression
STRING $expr = "RootType=='nctoolpath'"
// get the list of tool (sorted in the NCProgram order)
STRING LIST $tl_list = extract(filter(components(entity('ncprogram', $Selected_NCP)), $expr), 'tool.name')
INT Nb=remove_duplicates($tl_list)

/// Liste tous les outils
FOREACH ToolName IN $tl_list {&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's longer but better . And because it's better I think you can do what you want by adding a sort instruction ... in the $Tl_List definition .. I need to check that ..&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 15:24:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726592#M23341</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2018-01-26T15:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726780#M23342</link>
      <description>&lt;P&gt;Yes, simple .. I've just made the test : Add to the previous code&amp;nbsp;a &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;sort&lt;/STRONG&gt; &lt;/FONT&gt;instruction &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;// build the expression
STRING $expr = "RootType=='nctoolpath'"
// get the list of tool (sorted in the NCProgram order)
STRING LIST $tl_list = extract(&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;sort(&lt;/STRONG&gt;&lt;/FONT&gt;filter(components(entity('ncprogram', $Selected_NCP)), $expr) &lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;,'tool.number')&lt;/FONT&gt;&lt;/STRONG&gt; , 'tool.name')
INT Nb=remove_duplicates($tl_list)
/// Liste tous les outils
FOREACH ToolName IN $tl_list {&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;: &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jan 2018 15:55:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7726780#M23342</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2018-01-26T15:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7730942#M23343</link>
      <description>&lt;P&gt;So i've tried replacing the code, but im not quite sure where to put it or what to delete&lt;/P&gt;&lt;P&gt;Am i even close or?&lt;/P&gt;&lt;P&gt;Stops at first ENTITY&amp;nbsp;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://forums.autodesk.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes i've also experinced the fault with the tool names, mainly because in my country we use "ÆØÅ" and when changed the tool name in the list it still couldnt save the image, but figured it out like 2 weeks ago&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;STRING $Fold=''
STRING $CFold=''
STRING $Sz="80p" 

// build the expression
STRING $expr = "RootType=='nctoolpath'"
// get the list of tool (sorted in the NCProgram order)
STRING LIST $tl_list = extract(sort(filter(components(entity('ncprogram', $Selected_NCP)), $expr) ,'tool.number') , 'tool.name')
INT Nb=remove_duplicates($tl_list)
/// Liste tous les outils
FOREACH ToolName IN $tl_list {
ENTITY $tp=entity('Tool',$Tl)
        $ToolName = $tp.name
	ENTITY C_Tool = entity('Tool',$ToolName)
	$Fold=dirname(Pathname($C_Tool))
		
	IF $Fold != $CFold {
		// MESSAGE INFO " $Fold   $CFold " 
		$Ligne = "&amp;lt;TR&amp;gt;&amp;lt;TD colspan=10 style='background:#4F81BD'&amp;gt;&amp;lt;H3&amp;gt;"+ $Fold + "&amp;lt;/H3&amp;gt;&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;"
		FILE WRITE $Ligne TO filename
		$CFold=$Fold	
	}
	
	// Depuis les Outils
	$Ligne = "&amp;lt;TR&amp;gt;"
	FILE WRITE $Ligne TO filename
        // Image
        
        $Ligne = "&amp;lt;TD&amp;gt;"
        FILE WRITE $Ligne TO filename
        $Ligne = '&amp;lt;div align="' + 'center"' + '&amp;gt;'
        FILE WRITE $Ligne TO filename
        
        // CREATION IMAGE
	$ModiToolName=REPLACE($ToolName," ","_")
	$ModiToolName=REPLACE($ModiToolName,"/","-") // Corrige les nom outils du type  1/4 Endmill&lt;/PRE&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;Marc W&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 07:22:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7730942#M23343</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-29T07:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731522#M23344</link>
      <description>&lt;P&gt;try with this code ..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And for your issue with your langage .. I Just have the solution to add the different REPLACE instruction :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$ModiToolName=REPLACE($ModiToolName,"Æ","AE")&lt;/P&gt;
&lt;P&gt;$ModiToolName=REPLACE($ModiToolName,"Ø","O")&lt;/P&gt;
&lt;P&gt;$ModiToolName=REPLACE($ModiToolName,"Å","A")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Etc ..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 11:27:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731522#M23344</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2018-01-29T11:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731627#M23345</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="1.JPG" style="width: 489px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/456148i3E0C77C1E88EC552/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;Im getting some errors &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.JPG" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/456149iD4D1D9A8478715D7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 12:10:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731627#M23345</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-29T12:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731741#M23346</link>
      <description>&lt;P&gt;Oup's&amp;nbsp;&amp;nbsp; It was the wrong macro &lt;img id="smileyembarrassed" class="emoticon emoticon-smileyembarrassed" src="https://forums.autodesk.com/i/smilies/16x16_smiley-embarrassed.png" alt="Smiley Embarassed" title="Smiley Embarassed" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This one is used to create the toollist from a selected NCProgram.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try with this one&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, 29 Jan 2018 13:06:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731741#M23346</guid>
      <dc:creator>5axes</dc:creator>
      <dc:date>2018-01-29T13:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for Toolist</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731841#M23347</link>
      <description>&lt;P&gt;Works like a charm, thank you so much&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Marc W&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2018 13:20:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-for-toolist/m-p/7731841#M23347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-29T13:20:56Z</dc:date>
    </item>
  </channel>
</rss>

