<?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 help for changing the output and model location workplanes in NC Program in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12761327#M1876</link>
    <description>&lt;P&gt;Thank you. I am going to give this a try&lt;/P&gt;</description>
    <pubDate>Wed, 08 May 2024 20:54:14 GMT</pubDate>
    <dc:creator>travisb3WVSU</dc:creator>
    <dc:date>2024-05-08T20:54:14Z</dc:date>
    <item>
      <title>macro help for changing the output and model location workplanes in NC Program</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12751273#M1874</link>
      <description>&lt;P&gt;Here is what I got so far. I wanted a way to change workplanes for every toolpath when I brought in a new workpiece. So far this works to switch from a workplane named "OLD" to a user input text for a different workplane. I also have it delete "OLD" workplane in the NCGLOBAL page and that works. The program I am having is getting the user input text to also change the output and model location workplane. I don't know how to enter the variable to make it automated.&lt;/P&gt;&lt;P&gt;Here is what I got:&lt;/P&gt;&lt;DIV&gt;//THE INTENTION OF THIS MACRO IS TO REPLACE THE WORKPLANE FOR ONLY THOSE TOOLPATHS&lt;/DIV&gt;&lt;DIV&gt;//USING WORKPLANE "OLD" WITH WORKPLANE NAMED BY USER INPUT PROMPT for "new workplane name"&lt;/DIV&gt;&lt;DIV&gt;//&lt;/DIV&gt;&lt;DIV&gt;//&lt;/DIV&gt;&lt;DIV&gt;string wpName = ""&lt;/DIV&gt;&lt;DIV&gt;string oldwpname = "OLD"&lt;/DIV&gt;&lt;DIV&gt;STRING $UserInputText= INPUT "new workplane name"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;DEACTIVATE TOOLPATH&lt;/DIV&gt;&lt;DIV&gt;GRAPHICS LOCK&lt;/DIV&gt;&lt;DIV&gt;FOREACH tp IN folder('Toolpath') {&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$wpName = $tp.workplane.name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF $wpName == $oldwpname {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DEACTIVATE TOOLPATH&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;INVALIDATE TOOLPATH NOQUERY $tp.name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$tp.workplane = $UserInputText&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ACTIVATE TOOLPATH $tp.Name&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;EDIT TOOLPATH $tp.Name REAPPLY&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;GRAPHICS UNLOCK&lt;/DIV&gt;&lt;DIV&gt;FORM NCGLOBAL&lt;/DIV&gt;&lt;DIV&gt;►►EDIT NCPROGRAM ALL MODELLOCATION ""◄◄ This is where I need help&lt;/DIV&gt;&lt;DIV&gt;►►EDIT NCPROGRAM ALL WORKPLANE ""◄◄&amp;nbsp;This is where I need help&lt;/DIV&gt;&lt;DIV&gt;NCGLOBAL APPLY&lt;/DIV&gt;&lt;DIV&gt;NCGLOBAL ACCEPT&lt;/DIV&gt;&lt;DIV&gt;DELETE WORKPLANE "OLD"&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 May 2024 16:52:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12751273#M1874</guid>
      <dc:creator>travisb3WVSU</dc:creator>
      <dc:date>2024-05-03T16:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: macro help for changing the output and model location workplanes in NC Program</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12757082#M1875</link>
      <description>&lt;P&gt;If i save a template file and wish to change the output workplane referenced by the tool paths i use the following to change the workplane.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Create a list of NCPrograms in session and prompt user to select those for post change&lt;BR /&gt;ENTITY LIST NCPrograms = INPUT ENTITY MULTIPLE NCPROGRAM "Select NCPrograms for Output WP change"&lt;/P&gt;&lt;P&gt;ENTITY LIST $Workplane = INPUT ENTITY Workplane "Pick Workplane for PGM Output"&lt;BR /&gt;string $WP = $Workplane.name&lt;/P&gt;&lt;P&gt;Activate Workplane $WP&lt;/P&gt;&lt;P&gt;//change out wp in selected programs&lt;BR /&gt;FOREACH $pg IN NCPrograms {&lt;BR /&gt;ACTIVATE NCProgram $pg.Name&lt;/P&gt;&lt;P&gt;EDIT NCPROGRAM # SET WORKPLANE $wp&lt;BR /&gt;NCTOOLPATH APPLY&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So basically a foreach command rather globally , hope this is of some use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 06:23:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12757082#M1875</guid>
      <dc:creator>kevin.hammond3WX4X</dc:creator>
      <dc:date>2024-05-07T06:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: macro help for changing the output and model location workplanes in NC Program</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12761327#M1876</link>
      <description>&lt;P&gt;Thank you. I am going to give this a try&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 20:54:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12761327#M1876</guid>
      <dc:creator>travisb3WVSU</dc:creator>
      <dc:date>2024-05-08T20:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: macro help for changing the output and model location workplanes in NC Program</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12761447#M1877</link>
      <description>&lt;P&gt;This worked so well. I made a few changes and added it into my original macro now the whole process is automated and the user can select the workplane and the nc programs to change right at the beginning. Thank you so much for your help this made my day.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 22:05:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-help-for-changing-the-output-and-model-location-workplanes/m-p/12761447#M1877</guid>
      <dc:creator>travisb3WVSU</dc:creator>
      <dc:date>2024-05-08T22:05:06Z</dc:date>
    </item>
  </channel>
</rss>

