<?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: Rename toolpath macro in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12202448#M3478</link>
    <description>&lt;P&gt;here's the one I use. you'll have to modify it to suit your needs&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 20:37:32 GMT</pubDate>
    <dc:creator>TK.421</dc:creator>
    <dc:date>2023-08-28T20:37:32Z</dc:date>
    <item>
      <title>Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12202095#M3477</link>
      <description>&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;I am looking for a Macro that will add a prefix to all selected toolpaths, but with a variable .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to add "OP 10"&lt;/P&gt;&lt;P&gt;then next toolpath add "OP 20"&lt;/P&gt;&lt;P&gt;"OP 30" and so on...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have searched pretty well in forums and can not find one that suits this.&lt;/P&gt;&lt;P&gt;if so can anyone help me out?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 18:06:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12202095#M3477</guid>
      <dc:creator>todd.murphy8YH67</dc:creator>
      <dc:date>2023-08-28T18:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12202448#M3478</link>
      <description>&lt;P&gt;here's the one I use. you'll have to modify it to suit your needs&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 20:37:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12202448#M3478</guid>
      <dc:creator>TK.421</dc:creator>
      <dc:date>2023-08-28T20:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12204230#M3479</link>
      <description>thanks for the solution, it does exactly what you said . I was hoping there was anymore solutions out there?</description>
      <pubDate>Tue, 29 Aug 2023 14:07:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12204230#M3479</guid>
      <dc:creator>todd.murphy8YH67</dc:creator>
      <dc:date>2023-08-29T14:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205017#M3480</link>
      <description>&lt;P&gt;i use following macros to Prefix or Suffix any selected entity in powermill explorer, except for folders.&lt;/P&gt;&lt;P&gt;I've bound em to&amp;nbsp; [control + y] and [shift + control + y]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Prefix:&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;entity LIST $input = explorer_selected_entities()
if size($input) &amp;lt;= 0 {
	return
}
string $prefix = input "Prefix"

if $prefix == ' ' {
	return
}

foreach $et in $input {
	string $newName = $prefix + $et.Name
	string $tempName = $newName
	int $i = 1
	while entity_exists($et.RootType, $newName) { 
		$newName = $tempName + '_' + $i
		$i = $i + 1
	}
	string $cmd = "Rename " + et.RootType + ' "' + $et.Name + '" "' + $newName + '"'	
	DoCommand $cmd
}&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;Suffix:&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;entity LIST $input = explorer_selected_entities()
if size($input) &amp;lt;= 0 {
	return
}
string $suffix = input "Suffix"

if $suffix == ' ' {
	return
}

foreach $et in $input {
	string $newName =  $et.Name + $suffix
	string $tempName = $newName
	int $i = 1
	while entity_exists($et.RootType, $newName) { 
		$newName = $tempName + '_' + $i
		$i = $i + 1
	}
	string $cmd = "Rename " + et.RootType + ' "' + $et.Name + '" "' + $newName + '"'	
	DoCommand $cmd
}&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;Following macro adds a prefix and an increasing number to the name:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;entity LIST $input = explorer_selected_entities()
if size($input) &amp;lt;= 0 {
	return
}
string $prefix = input "Prefix"

if $prefix == ' ' {
	return
}

int $counter = 0

foreach $et in $input {
	$counter = $counter + 10
	string $newName = $prefix + '_' + $counter + '_' + $et.Name
	string $tempName = $newName
	int $i = 1
	while entity_exists($et.RootType, $newName) { 
		$newName = $tempName + '_' + $i
		$i = $i + 1
	}
	string $cmd = "Rename " + et.RootType + ' "' + $et.Name + '" "' + $newName + '"'	
	DoCommand $cmd
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I couldn't test it because I'm not at work...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 19:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205017#M3480</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2023-08-29T19:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205197#M3481</link>
      <description>&lt;P&gt;Beautiful, thanks a lot&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14304290"&gt;@icse&lt;/a&gt;&amp;nbsp;, only thing i wished it asked which programs, but the fix was for me to highlight all toolpaths prior to running the macros.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 20:06:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205197#M3481</guid>
      <dc:creator>todd.murphy8YH67</dc:creator>
      <dc:date>2023-08-29T20:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205315#M3482</link>
      <description>&lt;P&gt;Do you want to execute this on all toolpaths within an NC program?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;entity $nc = input entity ncprogram "Chose NC PGM"
foreach $tp in components($nc) {
	//do the rename
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 21:14:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205315#M3482</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2023-08-29T21:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205361#M3483</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14304290"&gt;@icse&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;No just what is in the toolpath folder.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 21:35:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205361#M3483</guid>
      <dc:creator>todd.murphy8YH67</dc:creator>
      <dc:date>2023-08-29T21:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rename toolpath macro</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205389#M3484</link>
      <description>&lt;P&gt;like this?&lt;/P&gt;&lt;LI-CODE lang="general"&gt;entity $input= input entity multiple toolpath "Chose"
foreach $tp in $input {
	//do the rename
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Aug 2023 21:53:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/rename-toolpath-macro/m-p/12205389#M3484</guid>
      <dc:creator>icse</dc:creator>
      <dc:date>2023-08-29T21:53:15Z</dc:date>
    </item>
  </channel>
</rss>

