<?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 to Auto adjust Overhang, using holder profile in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/9349091#M12400</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;ENTITY LIST usedTools = extract(folder('toolpath'), 'tool')
INT Duplicates = remove_duplicates($usedTools) 

FOREACH t IN $usedTools {
  EDIT TOOL $t.Name PROFILE_INCLUDE_ALL
  EDIT TOOL $t.Name UPDATE_TOOLPATHS_PROFILE
  IF NOT locked($t.Diameter) {
    EDIT TOOL $t.Name AUTO_OVERHANG
  } 
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The locked() function checks if a parameter is locked (tool diameter is a good check if a tool is locked).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. I also changed your variable name in the loop from 'tool' to 't' as it isn't good practice to use variables with the same name as PowerMill entities.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 18:05:15 GMT</pubDate>
    <dc:creator>mark.sully</dc:creator>
    <dc:date>2020-02-28T18:05:15Z</dc:date>
    <item>
      <title>Macro to Auto adjust Overhang, using holder profile</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/9348885#M12399</link>
      <description>&lt;P&gt;I've got a macro that will calculate the holder profile for all tools being used. The issue I have is when I add a line of code auto adjust the overhang based on the holder profile. It works just fine, until it comes across a locked tools. So I have been trying to get something to detect that the tool is locked, and if so, not calculate the overhang.&lt;BR /&gt;&lt;BR /&gt;I have used ERROR DOCOMMAND in the past to catch things like this, but I can't seem to get the syntax right for DOCOMMAND to work properly. I am using powermill 2015&amp;nbsp;&lt;BR /&gt;Here's what I have, any ideas would be appreciated:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ENTITY LIST usedTools = {} 
$usedTools = extract(folder('toolpath'), 'tool')
INT Duplicates = 0
$Duplicates = remove_duplicates($usedTools) 


FOREACH tool IN $usedTools {
    EDIT TOOL $tool PROFILE_INCLUDE_ALL
    EDIT TOOL $tool UPDATE_TOOLPATHS_PROFILE  
    BOOL error = 0
    STRING toolName = $tool.name 
    STRING cmd = "EDIT TOOL" + $toolName + "AUTO_OVERHANG"
    $error = ERROR DOCOMMAND $cmd
    IF NOT $error {
       EDIT TOOL $toolName AUTO_OVERHANG
   } 
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 16:42:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/9348885#M12399</guid>
      <dc:creator>Sean570</dc:creator>
      <dc:date>2020-02-28T16:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Auto adjust Overhang, using holder profile</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/9349091#M12400</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;ENTITY LIST usedTools = extract(folder('toolpath'), 'tool')
INT Duplicates = remove_duplicates($usedTools) 

FOREACH t IN $usedTools {
  EDIT TOOL $t.Name PROFILE_INCLUDE_ALL
  EDIT TOOL $t.Name UPDATE_TOOLPATHS_PROFILE
  IF NOT locked($t.Diameter) {
    EDIT TOOL $t.Name AUTO_OVERHANG
  } 
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The locked() function checks if a parameter is locked (tool diameter is a good check if a tool is locked).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. I also changed your variable name in the loop from 'tool' to 't' as it isn't good practice to use variables with the same name as PowerMill entities.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 18:05:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/9349091#M12400</guid>
      <dc:creator>mark.sully</dc:creator>
      <dc:date>2020-02-28T18:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Auto adjust Overhang, using holder profile</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/9361653#M12401</link>
      <description>&lt;P&gt;Thanks! That works perfectly. I searched through the parameters/functions many times but it seems I missed that one. I just adjusted the macro to check if the overhang is locked instead of the diameter.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ENTITY LIST usedTools = {} 
  $usedTools = extract(folder('toolpath'), 'tool')
  INT Duplicates = 0
  $Duplicates = remove_duplicates($usedTools) 

    FOREACH tl IN $usedTools {
    EDIT TOOL $tl.Name PROFILE_INCLUDE_ALL
    EDIT TOOL $tl.Name UPDATE_TOOLPATHS_PROFILE
    IF NOT locked($tl.Overhang) {
      EDIT TOOL $tl.Name AUTO_OVERHANG
    } 
  }&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Mar 2020 21:27:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/9361653#M12401</guid>
      <dc:creator>Sean570</dc:creator>
      <dc:date>2020-03-05T21:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to Auto adjust Overhang, using holder profile</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/12071843#M12402</link>
      <description>&lt;P&gt;Please, create this macro for single toolpath&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 13:49:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-auto-adjust-overhang-using-holder-profile/m-p/12071843#M12402</guid>
      <dc:creator>mayankpatel5523</dc:creator>
      <dc:date>2023-06-30T13:49:42Z</dc:date>
    </item>
  </channel>
</rss>

