<?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: Project Parameters - Delete All in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532086#M5131</link>
    <description>&lt;P&gt;So there is actually a form that can lists all the project variables, and there are a few that we never want to delete. If you type in&amp;nbsp;FORM PROJECTVARS in the command window you will see this dialog:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sean571_0-1667600485760.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1136390iFFE0980A9DCE8E21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sean571_0-1667600485760.png" alt="Sean571_0-1667600485760.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So it's not pretty but this works:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;string list defaultProjectVars = {"A360", "Customer", "FusionProductionJob", "HoleTagCatalog", "Notes", "OrderNumber", "PartName", "Programmer", "ProjectHistory", "TextBlocks", "ThicknessSets", "Tolerances"}

FOREACH par IN $project._keys { 
   If NOT member(defaultProjectVars, par) {
      string $cmd = "EDIT USERPAR project SELECT '" + $par + "'"
      DOCOMMAND $cmd     
      DELETE USERPAR project SELECTED 
   }      
}&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 04 Nov 2022 22:35:24 GMT</pubDate>
    <dc:creator>Sean571</dc:creator>
    <dc:date>2022-11-04T22:35:24Z</dc:date>
    <item>
      <title>Project Parameters - Delete All</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532034#M5127</link>
      <description>&lt;P&gt;Hey folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to build a macro that will completely wipe the project parameters(user defined settings), and I cannot seem to get a list or foreach loop to detect the parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I have so far but I keep getting an error that it cannot be evaluated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;FOREACH par IN FOLDER($Project._keys) {

        EDIT USERPAR project SELECT $par

        DELETE USERPAR project SELECTED

}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for anyone that may have some insight into this matter.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 21:42:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532034#M5127</guid>
      <dc:creator>barr.jarryd</dc:creator>
      <dc:date>2022-11-04T21:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Project Parameters - Delete All</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532065#M5128</link>
      <description>&lt;P&gt;You need to remove the folder() and then also put the command in a DOCOMMAND. It's annoying but it's the only way to get variables to work in this case&lt;/P&gt;&lt;LI-CODE lang="general"&gt;FOREACH par IN $project._keys { 
    string $cmd = "EDIT USERPAR project SELECT '" + $par + "'"
    DOCOMMAND $cmd     
    DELETE USERPAR project SELECTED 
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 22:13:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532065#M5128</guid>
      <dc:creator>Sean571</dc:creator>
      <dc:date>2022-11-04T22:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Project Parameters - Delete All</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532070#M5129</link>
      <description>&lt;P&gt;Shoot. This worked except it tries to delete more than what we want. Give me a sec and I'll come up with a solution&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sean571_0-1667600129475.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1136389i700D39B35E37BEDD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sean571_0-1667600129475.png" alt="Sean571_0-1667600129475.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 22:15:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532070#M5129</guid>
      <dc:creator>Sean571</dc:creator>
      <dc:date>2022-11-04T22:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: Project Parameters - Delete All</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532080#M5130</link>
      <description>&lt;P&gt;I got as far as doing this,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But $parameterName keeps giving me an error&lt;/P&gt;&lt;LI-CODE lang="general"&gt;FUNCTION Main() {

    INT parameterCount = 0 

    STRING parameterName = ""

    bool check = 1

    DIALOGS ERROR OFF

    WHILE $check == 1 {

        $parameterName = $project._keys[$parameterCount]

        EDIT USERPAR project SELECT $parameterName

        DELETE USERPAR project SELECTED

        $parameterCount = $parameterCount + 1

        $check = entity_exists($project._keys[$parameterCount])

    }

        MESSAGE INFO "All parameters deleted"

        DIALOGS ERROR ON

        MACRO ABORT ALL


}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 22:27:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532080#M5130</guid>
      <dc:creator>barr.jarryd</dc:creator>
      <dc:date>2022-11-04T22:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Project Parameters - Delete All</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532086#M5131</link>
      <description>&lt;P&gt;So there is actually a form that can lists all the project variables, and there are a few that we never want to delete. If you type in&amp;nbsp;FORM PROJECTVARS in the command window you will see this dialog:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sean571_0-1667600485760.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1136390iFFE0980A9DCE8E21/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sean571_0-1667600485760.png" alt="Sean571_0-1667600485760.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So it's not pretty but this works:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;string list defaultProjectVars = {"A360", "Customer", "FusionProductionJob", "HoleTagCatalog", "Notes", "OrderNumber", "PartName", "Programmer", "ProjectHistory", "TextBlocks", "ThicknessSets", "Tolerances"}

FOREACH par IN $project._keys { 
   If NOT member(defaultProjectVars, par) {
      string $cmd = "EDIT USERPAR project SELECT '" + $par + "'"
      DOCOMMAND $cmd     
      DELETE USERPAR project SELECTED 
   }      
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 22:35:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532086#M5131</guid>
      <dc:creator>Sean571</dc:creator>
      <dc:date>2022-11-04T22:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Project Parameters - Delete All</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532091#M5132</link>
      <description>&lt;P&gt;That worked awesome thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ended up with this by the end but yours is much better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;RESET LOCALVARS

    INT parameterCount = 0 

    STRING parameterName = ""

    STRING parameterCheck = ""

    STRING cmd = ""

    bool check = 0

    DIALOGS ERROR OFF

    WHILE $check == 0 {

        $parameterName = $project._keys[$parameterCount]

        $cmd = "EDIT USERPAR project SELECT " + "'" + $parameterName + "'"

        DOCOMMAND $cmd

        DELETE USERPAR project   SELECTED

        $parameterCount = $parameterCount + 1

        $parameterCheck = "$" + "project." + $parameterName

        $check = ERROR $parameterCheck

    }

        MESSAGE INFO "All parameters deleted"

        DIALOGS ERROR ON

        MACRO ABORT ALL&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 22:41:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11532091#M5132</guid>
      <dc:creator>barr.jarryd</dc:creator>
      <dc:date>2022-11-04T22:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Project Parameters - Delete All</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11535755#M5133</link>
      <description>&lt;P&gt;I've been looking for a solution myself to this exact problem. Thanks for sharing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 13:07:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/project-parameters-delete-all/m-p/11535755#M5133</guid>
      <dc:creator>danmic7JH66</dc:creator>
      <dc:date>2022-11-07T13:07:41Z</dc:date>
    </item>
  </channel>
</rss>

