<?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: help for rename toolpath... in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12178215#M3591</link>
    <description>&lt;P&gt;Try this macro:&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;string list $subFolders = get_folders('Toolpath')
int $index = input choice $subFolders 'Select Folder'


string $lastToolName = ''
int $counter = 0
int $subCounter = 0

foreach $tp in folder($subFolders[$index]) {
	
	if $tp.Tool.Name != $lastToolName {
		$subCounter = 0
		$counter = $counter + 1
		string $newName = $counter + '-' + $tp.Tool.Name
		rename toolpath $tp $newName
	} else {
		$subCounter = $subCounter + 1
		string $newName = $counter + '+' + $subCounter
		rename toolpath $tp $newName
	}
	$lastToolName = $tp.Tool.Name
}&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;</description>
    <pubDate>Thu, 17 Aug 2023 18:29:21 GMT</pubDate>
    <dc:creator>icse</dc:creator>
    <dc:date>2023-08-17T18:29:21Z</dc:date>
    <item>
      <title>help for rename toolpath...</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12176479#M3590</link>
      <description>&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6333968295112w168h168r255" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6333968295112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6333968295112w168h168r255');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6333968295112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;&lt;P&gt;Help me create a renaming macro as shown:&lt;BR /&gt;for example: using the same tool, change the name: 1-D10 and 2-D10 ---&amp;gt; 1-D10 and 1+1&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 03:50:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12176479#M3590</guid>
      <dc:creator>lamtuyphong11</dc:creator>
      <dc:date>2023-08-17T03:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: help for rename toolpath...</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12178215#M3591</link>
      <description>&lt;P&gt;Try this macro:&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;string list $subFolders = get_folders('Toolpath')
int $index = input choice $subFolders 'Select Folder'


string $lastToolName = ''
int $counter = 0
int $subCounter = 0

foreach $tp in folder($subFolders[$index]) {
	
	if $tp.Tool.Name != $lastToolName {
		$subCounter = 0
		$counter = $counter + 1
		string $newName = $counter + '-' + $tp.Tool.Name
		rename toolpath $tp $newName
	} else {
		$subCounter = $subCounter + 1
		string $newName = $counter + '+' + $subCounter
		rename toolpath $tp $newName
	}
	$lastToolName = $tp.Tool.Name
}&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;</description>
      <pubDate>Thu, 17 Aug 2023 18:29:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12178215#M3591</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2023-08-17T18:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: help for rename toolpath...</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12179221#M3592</link>
      <description>&lt;P&gt;it's great.Thank you so much....:))&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 01:26:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12179221#M3592</guid>
      <dc:creator>lamtuyphong11</dc:creator>
      <dc:date>2023-08-18T01:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: help for rename toolpath...</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12179238#M3593</link>
      <description>&lt;P&gt;Can you help me a little more ? ...i want these toolpaths to be able to go into 1 folder. can you help me ...&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6334159770112w804h482r510" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6334159770112" data-account="6057940548001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6057940548001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6334159770112w804h482r510');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://forums.autodesk.com/t5/video/gallerypage/video-id/6334159770112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 01:40:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12179238#M3593</guid>
      <dc:creator>lamtuyphong11</dc:creator>
      <dc:date>2023-08-18T01:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: help for rename toolpath...</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12179914#M3594</link>
      <description>&lt;P&gt;It probly get messed up if the selected folder got subfolders.... so use with care&lt;/P&gt;&lt;P&gt;also i added a warning so the macro does not run if the project was not saved before&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;if length(project_pathname(0)) == 0 OR project_modified() == 1 {
	message warn 'Please Save Project first'
	return
}

string list $subFolders = get_folders('Toolpath')
int $index = input choice $subFolders 'Select Folder'


string $lastToolName = ''
string $desinationFolder = ''
string $folderName = ''
int $counter = 0
int $subCounter = 0

foreach $tp in folder($subFolders[$index]) {
	
	if $tp.Tool.Name != $lastToolName {
	
		$subCounter = 0
		$counter = $counter + 1
		string $newName = $counter + '-' + $tp.Tool.Name
		
		string $folderPath = $subFolders[$index]
				
		string $tempName = $newName
		$folderName = $newName
		int $i = 1
		while folder_exists($folderPath + '\' + $folderName) { 
			$folderName = $tempName + '_' + $i
			$i = $i + 1
		}
		$desinationFolder = $folderPath + '\' + $folderName
		
		CREATE FOLDER $folderPath $folderName		
		
		if entity_exists(entity('toolpath',$newName)) {
			$newName = new_entity_name('toolpath',$newName)
		}
		
		rename toolpath $tp $newName
		
		EDIT FOLDER $desinationFolder INSERT $newName LAST
		
	} else {
	
		$subCounter = $subCounter + 1
		string $newName = $counter + '+' + $subCounter
		
		if entity_exists(entity('toolpath',$newName)) {
			$newName = new_entity_name('toolpath',$newName)
		}
		
		rename toolpath $tp $newName		
		EDIT FOLDER $desinationFolder INSERT $newName LAST
	}
	
	$lastToolName = $tp.Tool.Name
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i'm not quite happy with it so i probly do a rework on the weekend&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 09:31:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12179914#M3594</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2023-08-18T09:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: help for rename toolpath...</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12181831#M3595</link>
      <description>&lt;P&gt;It's also great. but it's not complete yet. very succulent you help. Thank you very much&lt;/P&gt;</description>
      <pubDate>Sat, 19 Aug 2023 01:21:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/help-for-rename-toolpath/m-p/12181831#M3595</guid>
      <dc:creator>lamtuyphong11</dc:creator>
      <dc:date>2023-08-19T01:21:57Z</dc:date>
    </item>
  </channel>
</rss>

