<?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] Automatic selecting the corresponding possprocessor in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405835#M25649</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have tested this code right now, and it works. What PM version? First try restarting Pmill.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2017 09:11:32 GMT</pubDate>
    <dc:creator>kukelyk</dc:creator>
    <dc:date>2017-09-25T09:11:32Z</dc:date>
    <item>
      <title>[Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405162#M25644</link>
      <description>&lt;P&gt;Hello all forum member!&lt;/P&gt;&lt;P&gt;I am a PowerMill programmer but just an amateur in creating macro, I have an issue that would very much like &amp;nbsp;your helping&lt;/P&gt;&lt;P&gt;My program is using 2 head ---1 head name" TIC " for roughing and another one name "TOE" head for Finishing.with every Head , I use 2 difference possprocessor for coding.&lt;/P&gt;&lt;P&gt;I want when I run the macro before creating nc program, it will be select the correct possprocessor automatically. I do this base on the difference machine that I am using in toolpaths.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tic.jpg" style="width: 596px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/404852i3DFA7A5D00E89EB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="tic.jpg" alt="tic.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="toe.jpg" style="width: 606px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/404853iFB58E34804DD07BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="toe.jpg" alt="toe.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a macro :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FOREACH tp in folder('Toolpath') {&lt;BR /&gt;If MachineName= "Parpas_TOE_3-2-2016" {&lt;BR /&gt;FORM NCPREFERENCES&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES TAPEOPTIONS FILEOPEN&lt;BR /&gt;"C:\dcam\config\ductpost\Parpas_H530_TOE_5ax_v7.pmoptz"&lt;BR /&gt;PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TOE_3-2-2016"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES WORKPLANE "Mfg"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES MODELLOCATION "ML"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES CONNECTION MOVE_ROTATE&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES TOOLCOORDS TIP&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES MACHINECLEARANCE .5&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES HOLDERCLEARANCE 0.05&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES SHANKCLEARANCE 0.01&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES FIXTUREOFFSET NAME "1"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES FILEMASK "0000.H"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES PROJECT ON&lt;BR /&gt;NCPREFERENCES ACCEPT&lt;BR /&gt;}&lt;BR /&gt;If MachineName= "Parpas_TIC" {&lt;BR /&gt;FORM NCPREFERENCES&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES TAPEOPTIONS FILEOPEN&lt;BR /&gt;"C:\dcam\config\ductpost\Parpas_H530_TIC_5ax_v10.pmoptz"&lt;BR /&gt;PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TIC"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES WORKPLANE "Mfg"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES MODELLOCATION "ML"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES CONNECTION MOVE_ROTATE&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES TOOLCOORDS TIP&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES MACHINECLEARANCE .5&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES HOLDERCLEARANCE 0.05&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES SHANKCLEARANCE 0.01&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES FIXTUREOFFSET NAME "1"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES FILEMASK "0000.H"&lt;BR /&gt;EDIT NCPROGRAM PREFERENCES PROJECT ON&lt;BR /&gt;NCPREFERENCES ACCEPT&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is its error when I run the Macro&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error.jpg" style="width: 417px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/404854iDC869BF61ED2594E/image-size/large?v=v2&amp;amp;px=999" role="button" title="error.jpg" alt="error.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me you can. Thank you very much!&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, 25 Sep 2017 03:28:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405162#M25644</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-25T03:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405580#M25645</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;FOREACH tp in folder('Toolpath') {
	FORM NCPREFERENCES
	If $tp.machinetool.name= "Parpas_TOE_3-2-2016" {
		
		EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TOE_5ax_v7.pmoptz"
		PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"
		EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TOE_3-2-2016"
	}
	If $tp.machinetool.name= "Parpas_TIC" {
		EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TIC_5ax_v10.pmoptz"
		PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"
		EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TIC"

	}
	EDIT NCPROGRAM PREFERENCES WORKPLANE "Mfg"
	EDIT NCPROGRAM PREFERENCES MODELLOCATION "ML"
	EDIT NCPROGRAM PREFERENCES CONNECTION MOVE_ROTATE
	EDIT NCPROGRAM PREFERENCES TOOLCOORDS TIP
	EDIT NCPROGRAM PREFERENCES MACHINECLEARANCE .5
	EDIT NCPROGRAM PREFERENCES HOLDERCLEARANCE 0.05
	EDIT NCPROGRAM PREFERENCES SHANKCLEARANCE 0.01
	EDIT NCPROGRAM PREFERENCES FIXTUREOFFSET NAME "1"
	EDIT NCPROGRAM PREFERENCES FILEMASK "0000.H"
	EDIT NCPROGRAM PREFERENCES PROJECT ON
	NCPREFERENCES ACCEPT
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2017 07:33:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405580#M25645</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-25T07:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405746#M25646</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;K&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3959841" target="_self"&gt;ukelyk&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for your helping , however when I run your macro , it still has an error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ERROR2.jpg" style="width: 462px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/404933i1CACD4165C3477B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="ERROR2.jpg" alt="ERROR2.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;By the way, to get safer when coding, &amp;nbsp;what do I should do if I want to change my condition : &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-if Machine TOOL &amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;"Parpas_TOE_3-2-2016" AND ToolNumber&amp;gt;20, select &amp;nbsp;"C:\dcam\config\ductpost\Parpas_H530_TOE_5ax_v7.pmoptz"&lt;/P&gt;&lt;P&gt;-if&amp;nbsp;&lt;SPAN&gt;Machine TOOL &amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;"Parpas_TIC"&lt;SPAN&gt;" AND ToolNumber&amp;lt;20, select&lt;/SPAN&gt;"C:\dcam\config\ductpost\Parpas_H530_TIC_5ax_v10.pmoptz"&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hopefully received your helping.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;THANK YOU VERY MUCH!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 08:29:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405746#M25646</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-25T08:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405758#M25647</link>
      <description>&lt;P&gt;Sorry, my mistake ('==' instead of '='):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;FOREACH tp in folder('Toolpath') {
	FORM NCPREFERENCES
	If $tp.machinetool.name == "Parpas_TOE_3-2-2016" {
		
		EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TOE_5ax_v7.pmoptz"
		PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"
		EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TOE_3-2-2016"
	}
	If $tp.machinetool.name == "Parpas_TIC" {
		EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TIC_5ax_v10.pmoptz"
		PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"
		EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TIC"

	} 
	EDIT NCPROGRAM PREFERENCES WORKPLANE "Mfg"
	EDIT NCPROGRAM PREFERENCES MODELLOCATION "ML"
	EDIT NCPROGRAM PREFERENCES CONNECTION MOVE_ROTATE
	EDIT NCPROGRAM PREFERENCES TOOLCOORDS TIP
	EDIT NCPROGRAM PREFERENCES MACHINECLEARANCE .5
	EDIT NCPROGRAM PREFERENCES HOLDERCLEARANCE 0.05
	EDIT NCPROGRAM PREFERENCES SHANKCLEARANCE 0.01
	EDIT NCPROGRAM PREFERENCES FIXTUREOFFSET NAME "1"
	EDIT NCPROGRAM PREFERENCES FILEMASK "0000.H"
	EDIT NCPROGRAM PREFERENCES PROJECT ON
	NCPREFERENCES ACCEPT
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 08:37:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405758#M25647</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-25T08:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405814#M25648</link>
      <description>&lt;P&gt;Same problem ,&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3959841" target="_self"&gt;kukelyk&lt;/A&gt;!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="error3.jpg" style="width: 440px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/404949i72589DD42C9A8E70/image-size/large?v=v2&amp;amp;px=999" role="button" title="error3.jpg" alt="error3.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hopefully continue receive your helping!Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 09:01:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405814#M25648</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-25T09:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405835#M25649</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have tested this code right now, and it works. What PM version? First try restarting Pmill.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 09:11:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405835#M25649</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-25T09:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405840#M25650</link>
      <description>&lt;P&gt;I will upgrade to PM 2018 soon but now I'm using PM 2016. Would you help me edit the macro file if my mine is early version than yours?&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 09:14:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405840#M25650</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-25T09:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405874#M25651</link>
      <description>&lt;P&gt;I have tested it on pm2016, with no problems&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 09:31:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405874#M25651</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-25T09:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405908#M25652</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3959841" target="_self"&gt;kukelyk&lt;/A&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please see the Video file of the problem and give me advice !&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=8W9vOY6RBB8&amp;amp;feature=youtu.be" target="_blank"&gt;https://www.youtube.com/watch?v=8W9vOY6RBB8&amp;amp;feature=youtu.be&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 09:47:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405908#M25652</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-25T09:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405934#M25653</link>
      <description>&lt;P&gt;Try run macro in debug mode line by line&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 10:07:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405934#M25653</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-25T10:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405943#M25654</link>
      <description>&lt;P&gt;This is what happen in debug&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="deburg.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/404959i2AC358019E621DAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="deburg.jpg" alt="deburg.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 10:14:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405943#M25654</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-25T10:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405953#M25655</link>
      <description>&lt;P&gt;What happen if You write it:&lt;/P&gt;
&lt;P&gt;PRINT = $toolpath.machinetool.name&lt;/P&gt;
&lt;P&gt;to the command window (and there is an active toolpath)?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 10:21:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405953#M25655</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-25T10:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405971#M25656</link>
      <description>&lt;P&gt;It show "Parpas_TIC"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TIC.jpg" style="width: 1007px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/404962iE87AB7B7DD2BAD2C/image-dimensions/1007x100?v=v2" width="1007" height="100" role="button" title="TIC.jpg" alt="TIC.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 10:31:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405971#M25656</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-25T10:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405997#M25657</link>
      <description>&lt;P&gt;Put a break point on line3 in the macro. Run the debugger until it stops on the breakpoint check that tp.machinetool is actually set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PRINT = entity_exists(tp.machinetool)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run the macro until it stops at the breakpoint again, and repeat the check. You probably have a toolpath where the machinetool isn't set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 10:54:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7405997#M25657</guid>
      <dc:creator>urizenYHS3W</dc:creator>
      <dc:date>2017-09-25T10:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7406098#M25658</link>
      <description>&lt;P&gt;Ok, I know what is the problem.&lt;/P&gt;
&lt;P&gt;Try this one:&lt;/P&gt;
&lt;PRE&gt;FOREACH tp in folder('Toolpath') {
	IF member($tp._keys, "machinetool") {
		FORM NCPREFERENCES
		If $tp.machinetool.name == "Parpas_TOE_3-2-2016" {
			EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TOE_5ax_v7.pmoptz"
			PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"
			EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TOE_3-2-2016"
		}
		If $tp.machinetool.name == "Parpas_TIC" {
			EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TIC_5ax_v10.pmoptz"
			PATHSELECTOR PATHLISTS LISTCHANGE OUTPUT PATHSELECTOR PATHLISTS CLEAR PATHSELECTOR PATHLISTS ADD "D:\PMill_PShape_Master_Reference\Code_Files"
			EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TIC"
		} 
		EDIT NCPROGRAM PREFERENCES WORKPLANE "Mfg"
		EDIT NCPROGRAM PREFERENCES MODELLOCATION "ML"
		EDIT NCPROGRAM PREFERENCES CONNECTION MOVE_ROTATE
		EDIT NCPROGRAM PREFERENCES TOOLCOORDS TIP
		EDIT NCPROGRAM PREFERENCES MACHINECLEARANCE .5
		EDIT NCPROGRAM PREFERENCES HOLDERCLEARANCE 0.05
		EDIT NCPROGRAM PREFERENCES SHANKCLEARANCE 0.01
		EDIT NCPROGRAM PREFERENCES FIXTUREOFFSET NAME "1"
		EDIT NCPROGRAM PREFERENCES FILEMASK "0000.H"
		EDIT NCPROGRAM PREFERENCES PROJECT ON
	} ELSE {
		//none of them used..
	}
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2017 11:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7406098#M25658</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-25T11:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7408182#M25659</link>
      <description>&lt;P&gt;Dear!&lt;/P&gt;&lt;P&gt;Thank you very much for your helping, I'm sorry for late feedback because I finish my work shift. it look like to help me touch my target but still have some issue , please take a little bit time let me present my whole problem&lt;/P&gt;&lt;P&gt;1.As I said, I have a list of toolpaths , among them, I have set 2 machine name "Parpas_TOE_3-2-2016" and "Parpas_TIC" in my toolpath setting.&lt;BR /&gt;2.Now, I want to run the macro (that is the macro &amp;nbsp;I would like your help).&lt;/P&gt;&lt;P&gt;After reference and try running all your Macro,This is the Macro that I edited, (but it still not &amp;nbsp;make me satisfy!!!!!!!!)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;FOREACH tp in folder('Toolpath') {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;IF member($tp._keys, "machinetool") {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If $tp.machinetool.name == "Parpas_TIC" {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TIC_5ax_v10.pmoptz"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;FORM NCPREFERENCES&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TIC" &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES WORKPLANE "Mfg"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES MODELLOCATION "ML"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES CONNECTION MOVE_ROTATE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES TOOLCOORDS TIP&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES MACHINECLEARANCE .5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES HOLDERCLEARANCE 0.05&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES SHANKCLEARANCE 0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES FIXTUREOFFSET NAME "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES FILEMASK "0000.H"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES PROJECT ON&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;NCPREFERENCES ACCEPT&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;If $tp.machinetool.name == "Parpas_TOE_3-2-2016" {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES TAPEOPTIONS "C:\dcam\config\ductpost\Parpas_H530_TOE_5ax_v7.pmoptz"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;FORM NCPREFERENCES&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES MACHINETOOL "Parpas_TOE_3-2-2016" &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES WORKPLANE "Mfg"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES MODELLOCATION "ML"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES CONNECTION MOVE_ROTATE&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES TOOLCOORDS TIP&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES MACHINECLEARANCE .5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES HOLDERCLEARANCE 0.05&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES SHANKCLEARANCE 0.01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES FIXTUREOFFSET NAME "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES FILEMASK "0000.H"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;EDIT NCPROGRAM PREFERENCES PROJECT ON&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;NCPREFERENCES ACCEPT&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;} ELSE {&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;//none of them used..&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;} &lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.After runing Macro, I will create the nc program:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nc1.jpg" style="width: 353px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/405256i6C5E09596D60F2B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="nc1.jpg" alt="nc1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is nc program setting that I created after running Macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tic1.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/405257i5445DC011EE5AFCE/image-size/large?v=v2&amp;amp;px=999" role="button" title="tic1.jpg" alt="tic1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="toe2.jpg" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/405258i321695B11F723AA1/image-size/large?v=v2&amp;amp;px=999" role="button" title="toe2.jpg" alt="toe2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of them using same machine and same possprocessor. That isn't what I want. I want IN NC PROGRAM ALSO USING THE SAME MACHINE IN TOOLPATH SEETING AND CORRECT POSSPROCESSOR FOR EVERY MACHINE!&lt;/P&gt;&lt;P&gt;Please take time help me for REVIEW and Edit them when you available, I really appreciate your helping!&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 02:47:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7408182#M25659</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-26T02:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7408695#M25660</link>
      <description>&lt;PRE&gt;EDIT NCPROGRAM PREFERENCES ...&lt;/PRE&gt;&lt;P&gt;Sets the default value for all NCPROGRAMS you need to change the values on the individual NCPROGRAMs. So instead of looping over the toolpaths you need to loop over the NC Programs&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;FOREACH prog IN folder('ncprogram) {
  IF size(components(prog)) != 1 {
     PRINT "NCProgram should only have 1 toolpath"
     MACRO ABORT
  }
  OBJECT nctp = components(prog)[0] {
  ENTITY tp = entity('toolpath',nctp.name)
  IF tp.machinetool.name == 'Parpas_TIC' {
    $prog.HolderClearance = .5
    // 
  } elseif ... {
  }
  break;
 }&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Sep 2017 08:13:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7408695#M25660</guid>
      <dc:creator>urizenYHS3W</dc:creator>
      <dc:date>2017-09-26T08:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7412279#M25661</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4282186"&gt;@urizenYHS3W&lt;/a&gt;&amp;nbsp;has right,&lt;/P&gt;
&lt;P&gt;If You edit the preferences two times in a row, then You set it only once. You cannot store two different cases here.&lt;/P&gt;
&lt;P&gt;So the best way to do what You want is the next:&lt;/P&gt;
&lt;P&gt;In a loop&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; -create ncprogram, append the toolpath for that&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; -check if the toolpath has machine setting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if yes, then set the postprocessor&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if no, than ask the user, and set the postprocessor&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;-set some more ncprogram options&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note, that in this case You should not set the postprocessor in the Preferences form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or, if You already have some ncprograms without correct postrocessor setting, then use what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4282186"&gt;@urizenYHS3W&lt;/a&gt;&amp;nbsp;suggests&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 07:22:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7412279#M25661</guid>
      <dc:creator>kukelyk</dc:creator>
      <dc:date>2017-09-27T07:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7412459#M25662</link>
      <description>&lt;P&gt;I use this to post a program to two different machines, using each time the correct PP, path and file extension:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;BOOL $repOK = 0
BOOL $OK = 0
STRING $Tp_Workplane = ""
EXPLORER SELECT FOLDER "NCProgram\Cincinnati" NEW
DEACTIVATE NCProgram
ENTITY LIST $ents = INPUT ENTITY MULTIPLE ncprogram "Selection des programmes"
FOREACH $nc IN $ents {
	ACTIVATE NCProgram $nc.Name
	// Check if workplane defined + if multi axis
	$repOK = ERROR $entity('ncprogram','').OutputWorkplane.Name
	if $repOK {
		MESSAGE ERROR nc.Name + " : Pas de repere de sortie defini !!!"
		RETURN
	}
	//PRINT $entity('ncprogram','').MultiAxis
	//IF $entity('ncprogram','').MultiAxis == 1 {
	FOREACH $Tp IN COMPONENTS($Nc) {
		IF LCASE($Tp.RootType) == 'nctoolpath' {
		// Get the toolpaths workplane name
		PRINT $Tp.Name
		//$Err = ERROR($entity('toolpath',$Tp.name).workplane.name)
			//IF NOT $Err {
				$Tp_Workplane = $entity('toolpath',$Tp.name).workplane.name
			//}
		// Exit Loop
        //BREAK
			IF $Tp_Workplane != $entity('ncprogram','').OutputWorkplane.Name {
				MESSAGE ERROR nc.Name + " : Programme 5 axes, controler le repere de " + Tp.name + " !!!"
				
				RETURN
			}
		}
	}
	// Cin 3x
	EDIT NCPROGRAM SELECTED FOLDER "P:\DNCNET\DNCNET_I\"\r
	NCSELECTED APPLY\r
	EDIT NCPROGRAM SELECTED FILEMASK  P:\DNCNET\DNCNET_I\{ncprogram}.tap
	NCSELECTED APPLY\r
	EDIT NCPROGRAM SELECTED TAPEOPTIONS "P:\Powermill\Post-processeurs\PM_CINCINNATI_A950_V1_0_1.pmoptz"
	NCSELECTED ACCEPT\r
	EDIT NCPROGRAM PREFERENCES CLIMBLEFTCOMP ON
	KEEP NCPROGRAM SELECTED\r
	YES\n
	// Cin 5x
	EDIT NCPROGRAM SELECTED FOLDER "P:\H5_800XT\"\r
	NCSELECTED APPLY\r
	EDIT NCPROGRAM SELECTED FILEMASK  P:\H5_800XT\{ncprogram}.PUN
	NCSELECTED APPLY\r
	EDIT NCPROGRAM SELECTED TAPEOPTIONS "P:\Powermill\Post-processeurs\PM_CINCINNATI_ACRAMATIC_V1_0_1.pmoptz"\r
	NCSELECTED ACCEPT\r
	KEEP NCPROGRAM SELECTED\r
	YES\n
}
DEACTIVATE NCProgram&lt;/PRE&gt;
&lt;P&gt;I basically correct all parameters and post the program to one machine and then correct them for the othre machine and post to it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you modify the macro to ask the user at the beginning and make a condition, the macro will then, according to the user's answer, correct the parameters to put it to the correct machine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a look at the first machine, I also make sure that the program's workplane is correctly defined, since it is a 3 axis machine. You can use such a macro to make all needed checks before posting. Just make the macro "sexy" enough to make sure that your guys will always use it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Olivier&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 08:28:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7412459#M25662</guid>
      <dc:creator>NanchenO</dc:creator>
      <dc:date>2017-09-27T08:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: [Macro] Automatic selecting the corresponding possprocessor</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7412654#M25663</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;Thank you all for your helping but I still not get my purpose.&lt;/P&gt;&lt;P&gt;I do this because I don't&amp;nbsp; want to get confuse in programming. My program usually have a lot of toolpaths (over 100) . According to our company template, I make 1 nc program for each toolpath so that mean I have to create a lot of nc program. So I don't want to set machine tool ,postprocessor and&amp;nbsp; some other things for each nc program ,&amp;nbsp;this will lead to&amp;nbsp;&amp;nbsp;make confuse&amp;nbsp;and take more time.&lt;/P&gt;&lt;P&gt;I already have 2 separate macro for each machine tool and possprocessor. IT IS running OK right now, but sometime, I and my Guys still have wrong machine tool when the program have too many program.&lt;/P&gt;&lt;P&gt;That's why I would like to look for a better Macro. Hopefully all of you could be help me continue fix this situation.&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 09:41:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-automatic-selecting-the-corresponding-possprocessor/m-p/7412654#M25663</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-27T09:41:40Z</dc:date>
    </item>
  </channel>
</rss>

