<?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 get toolpath selected folder names in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9109873#M13611</link>
    <description>Get use command to return the names to a list which was selected in toolpath tree nodes?</description>
    <pubDate>Sat, 26 Oct 2019 02:46:55 GMT</pubDate>
    <dc:creator>hx</dc:creator>
    <dc:date>2019-10-26T02:46:55Z</dc:date>
    <item>
      <title>get toolpath selected folder names</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9109873#M13611</link>
      <description>Get use command to return the names to a list which was selected in toolpath tree nodes?</description>
      <pubDate>Sat, 26 Oct 2019 02:46:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9109873#M13611</guid>
      <dc:creator>hx</dc:creator>
      <dc:date>2019-10-26T02:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: get toolpath selected folder names</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9110032#M13612</link>
      <description>&lt;P&gt;I only know a workaround for this problem:&amp;nbsp;&lt;A title="selected folder name" href="https://forums.autodesk.com/t5/powermill-forum/getting-then-selected-folder-name/m-p/8497952" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/powermill-forum/getting-then-selected-folder-name/m-p/8497952&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;The attached macro attempts to find the name of the selected folder in four ways:&lt;BR /&gt;1.use active_folder() function&lt;BR /&gt;2.use explorer_selected_entities() function&lt;BR /&gt;3.use active toolpath&lt;BR /&gt;4.select by list&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;ENTITY LIST SelectedToolpaths={}
STRING SelectedFolder=''
IF active_folder() != "" AND substring(active_folder(),0,8) == 'Toolpath' {
  $SelectedToolpaths=folder(active_folder())
  $SelectedFolder=active_folder()
} ELSE {
  ENTITY LIST SelItems=explorer_selected_entities()
  IF size($SelItems)&amp;gt;0 AND $SelItems[0].RootType=='toolpath' { 
    $SelectedToolpaths=folder(dirname(pathname($SelItems[0])))
    $SelectedFolder=dirname(pathname($SelItems[0]))
  } ELSEIF entity_exists('toolpath','') {
    $SelectedToolpaths=folder(dirname(pathname(entity('toolpath',''))))
    $SelectedFolder=dirname(pathname(entity('toolpath','')))
  } ELSE {
    STRING LIST FolderList=get_folders('toolpath')
    INT I=INPUT CHOICE $FolderList 'Please select folder'
    IF error($I) {
       RETURN
    }
    $SelectedToolpaths=folder($FolderList[$I])
    $SelectedFolder=$FolderList[$I]
  }
}
STRING LIST FolderList=get_folders($SelectedFolder)
  IF size($FolderList) &amp;gt; 0 {
    ENTITY LIST UnselectToolpaths={}
    FOREACH F IN $FolderList {
      $UnselectToolpaths=$UnselectToolpaths+folder($f)
    }
// subtract not working with entities: $Diff list is equal with $SelectedToolpath
    ENTITY LIST Diff={}
    $Diff=subtract($SelectedToolpaths,$UnselectToolpaths)
// subtract working with strings
    STRING LIST L1=extract($SelectedToolpaths,'Name')
    STRING LIST L2=extract($UnselectToolpaths,'Name')
    STRING LIST L3=subtract($L1,$L2)
    $SelectedToolpaths={}
    FOREACH item IN $L3 {
      INT I=add_last($SelectedToolpaths,entity('toolpath',$item))
    }
}
FOREACH tp IN $SelectedToolpaths {
  print=$tp.Name
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2019 09:12:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9110032#M13612</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-26T09:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: get toolpath selected folder names</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9734688#M13613</link>
      <description>&lt;P&gt;Is the folder displayed like this&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-09-08_17-25-32.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816417iA0C714EA5C532274/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2020-09-08_17-25-32.png" alt="2020-09-08_17-25-32.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 09:28:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9734688#M13613</guid>
      <dc:creator>Ye。xg</dc:creator>
      <dc:date>2020-09-08T09:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: get toolpath selected folder names</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9739918#M13614</link>
      <description>&lt;P&gt;I WISH TO GET THE NUMBER OF TOOLPATH IN 1 LIBRARY&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 12:56:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/get-toolpath-selected-folder-names/m-p/9739918#M13614</guid>
      <dc:creator>phocvet</dc:creator>
      <dc:date>2020-09-10T12:56:18Z</dc:date>
    </item>
  </channel>
</rss>

