<?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 Sort toolpaths by workplane position or boundary in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/9598589#M11245</link>
    <description>&lt;P&gt;So I have a macro that I use to split up a toolpath folder of drilling paths using the active boundary and keeps both paths. Is there a way to sort the resulting paths into separate folders, depending on if they were inside or outside of the boundary? Also, I'm using powermill 2015.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;   GRAPHICS LOCK
    DIALOGS MESSAGE OFF 

    STRING activeBoundary = ""
    IF ENTITY_EXISTS(ENTITY('BOUNDARY', '')) {
        $activeBoundary =  ENTITY('BOUNDARY', '').Name
    } ELSE {
        MACRO PAUSE "Activate a boundary!"
    }

    STRING fld = active_folder()
    IF POSITION($fld, "Toolpath") == -1 {
        GRAPHICS UNLOCK
        MACRO PAUSE "Please activate a toolpath folder"
        GRAPHICS LOCK
        $fld = active_folder()
    }
    FOREACH tp IN folder($fld){        
        ACTIVATE TOOLPATH $tp.name
        EDIT TOOLPATH LIMIT BOUNDARY
        EDIT TOOLPATH LIMIT BOUNDARYNAME $activeBoundary
        EDIT TOOLPATH LIMIT DELETE Y
        EDIT TOOLPATH LIMIT BOUNDPLANEOPTIONS ACTIVE_WORKPLANE
        EDIT TOOLPATH LIMIT KEEP BOTH
        PROCESS TPLIMIT
    }
    
    GRAPHICS UNLOCK
    DIALOGS MESSAGE ON&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I can't use the boundary itself, using the workplane coordinates to sort them would be the next best option. Since most of the toolpaths I am splitting are drilling toolpaths, I can't use boundaries while calculating them either. Any thoughts?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2020 14:18:44 GMT</pubDate>
    <dc:creator>Sean570</dc:creator>
    <dc:date>2020-06-24T14:18:44Z</dc:date>
    <item>
      <title>Sort toolpaths by workplane position or boundary</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/9598589#M11245</link>
      <description>&lt;P&gt;So I have a macro that I use to split up a toolpath folder of drilling paths using the active boundary and keeps both paths. Is there a way to sort the resulting paths into separate folders, depending on if they were inside or outside of the boundary? Also, I'm using powermill 2015.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;   GRAPHICS LOCK
    DIALOGS MESSAGE OFF 

    STRING activeBoundary = ""
    IF ENTITY_EXISTS(ENTITY('BOUNDARY', '')) {
        $activeBoundary =  ENTITY('BOUNDARY', '').Name
    } ELSE {
        MACRO PAUSE "Activate a boundary!"
    }

    STRING fld = active_folder()
    IF POSITION($fld, "Toolpath") == -1 {
        GRAPHICS UNLOCK
        MACRO PAUSE "Please activate a toolpath folder"
        GRAPHICS LOCK
        $fld = active_folder()
    }
    FOREACH tp IN folder($fld){        
        ACTIVATE TOOLPATH $tp.name
        EDIT TOOLPATH LIMIT BOUNDARY
        EDIT TOOLPATH LIMIT BOUNDARYNAME $activeBoundary
        EDIT TOOLPATH LIMIT DELETE Y
        EDIT TOOLPATH LIMIT BOUNDPLANEOPTIONS ACTIVE_WORKPLANE
        EDIT TOOLPATH LIMIT KEEP BOTH
        PROCESS TPLIMIT
    }
    
    GRAPHICS UNLOCK
    DIALOGS MESSAGE ON&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If I can't use the boundary itself, using the workplane coordinates to sort them would be the next best option. Since most of the toolpaths I am splitting are drilling toolpaths, I can't use boundaries while calculating them either. Any thoughts?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 14:18:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/9598589#M11245</guid>
      <dc:creator>Sean570</dc:creator>
      <dc:date>2020-06-24T14:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sort toolpaths by workplane position or boundary</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/9750938#M11246</link>
      <description>&lt;P&gt;When the toolpath is split using a boundary, a new toolpath is created.&amp;nbsp; That toolpath name should be recognized by the new_entity_name() function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;    FOREACH tp IN folder($fld){        
        ACTIVATE TOOLPATH $tp.name
        EDIT TOOLPATH LIMIT BOUNDARY
        EDIT TOOLPATH LIMIT BOUNDARYNAME $activeBoundary
        EDIT TOOLPATH LIMIT DELETE Y
        EDIT TOOLPATH LIMIT BOUNDPLANEOPTIONS ACTIVE_WORKPLANE
        EDIT TOOLPATH LIMIT KEEP BOTH
        PROCESS TPLIMIT
        //get the new toolpath name
        STRING $NewTpName = new_entity_name('toolpath', $tp.name)
        //put new toolpath into different folder
        EDIT FOLDER "Toolpath\Folder1" INSERT $NewTpName
        
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You should also add to the macro to either save the inner or outer portion.&amp;nbsp; That should guarantee which side of the boundary the new toolpath will be on.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2020 17:52:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/9750938#M11246</guid>
      <dc:creator>cfastNJWK6</dc:creator>
      <dc:date>2020-09-16T17:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Sort toolpaths by workplane position or boundary</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/10717656#M11247</link>
      <description>&lt;P&gt;Thanks for sharing &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6909551"&gt;@cfastNJWK6&lt;/a&gt;&amp;nbsp;. Few things to make it work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING $NewTpName = new_entity_name('toolpath', $tp.name) // do first before&amp;nbsp;PROCESS TPLIMIT&lt;BR /&gt;PROCESS TPLIMIT&lt;/P&gt;&lt;P&gt;EDIT FOLDER $folderName INSERT $NewTpName LAST //put new toolpath into different folder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also add folder creation as it may not exist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING folderName="Toolpath\" + $activeBoundary&lt;/P&gt;&lt;P&gt;IF NOT folder_exists($folderName) {&lt;BR /&gt;CREATE FOLDER "Toolpath" $activeBoundary&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 14:58:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/10717656#M11247</guid>
      <dc:creator>artur.boszczyk</dc:creator>
      <dc:date>2021-10-27T14:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sort toolpaths by workplane position or boundary</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/10717657#M11248</link>
      <description>&lt;P&gt;Thanks for sharing &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6909551"&gt;@cfastNJWK6&lt;/a&gt;&amp;nbsp;. Few things to make it work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING $NewTpName = new_entity_name('toolpath', $tp.name) // do first before&amp;nbsp;PROCESS TPLIMIT&lt;BR /&gt;PROCESS TPLIMIT&lt;/P&gt;&lt;P&gt;EDIT FOLDER $folderName INSERT $NewTpName LAST //put new toolpath into different folder&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would also add folder creation as it may not exist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING folderName="Toolpath\" + $activeBoundary&lt;/P&gt;&lt;P&gt;IF NOT folder_exists($folderName) {&lt;BR /&gt;CREATE FOLDER "Toolpath" $activeBoundary&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 14:59:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/sort-toolpaths-by-workplane-position-or-boundary/m-p/10717657#M11248</guid>
      <dc:creator>artur.boszczyk</dc:creator>
      <dc:date>2021-10-27T14:59:07Z</dc:date>
    </item>
  </channel>
</rss>

