<?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: Replace axis value in toolpath in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8261112#M19299</link>
    <description>&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;Userparameters should be a good idea.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;The only problem is the toolpaths that already contain B and C in the name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ENTITY LIST Toolpaths = INPUT ENTITY MULTIPLE TOOLPATH "Choose toolpaths to rename B and C axis"
FOREACH $tp IN $Toolpaths {
	ACTIVATE TOOLPATH $tp.name
	STRING TP_NAME = $tp.Name
	REAL axisB = round(machine().B, 4)
	REAL axisC = round(machine().C, 4)
	STRING New_AxisB = "B" + $axisB
	STRING New_AxisC = "C" + $axisC
	
	IF NOT Member($tp.userparameters._keys,"B_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "B_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
		$TP_NAME = $TP_NAME + " " + $New_AxisB
	}
	IF NOT Member($tp.userparameters._keys,"C_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "C_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
		$TP_NAME = $TP_NAME + " " + $New_AxisC
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
		CONTINUE
	}

	STRING Old_AxisB = $entity('toolpath';$tp.name).UserParameters.B_Axis
	STRING Old_AxisC = $entity('toolpath';$tp.name).UserParameters.C_Axis
	IF $Old_AxisB != $New_AxisB {
		$TP_NAME = replace($TP_NAME, $Old_AxisB, $New_AxisB)
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
	}
	IF $Old_AxisC != $New_AxisC {
		$TP_NAME = replace($TP_NAME, $Old_AxisC, $New_AxisC)
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
	}	
}
MESSAGE INFO "TOOLPATHS MODIFIED"&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Sep 2018 19:10:29 GMT</pubDate>
    <dc:creator>rafael.sansao</dc:creator>
    <dc:date>2018-09-11T19:10:29Z</dc:date>
    <item>
      <title>Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8260961#M19298</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I reached my macro limit at this point and I'd like some guidance.&lt;BR /&gt;What I'd like to achieve is replacing my axis value (B and C) in my toolpath and change is with a new one whitout having to tell the macro which value to replace.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I do is, I setup my machine tool and my origin, that I start the macro.&lt;BR /&gt;My toolpath looks like :&amp;nbsp;#1 - T25 - COMP SEMI Ø1.0085 B90 C30 OP33&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DIALOGS ERROR OFF&lt;BR /&gt;DIALOGS MESSAGE OFF&lt;/P&gt;&lt;P&gt;//STRING $New_Name = ""&lt;BR /&gt;ENTITY LIST Toolpaths = INPUT ENTITY MULTIPLE TOOLPATH "Choose toolpaths to rename B and C axis"&lt;/P&gt;&lt;P&gt;STRING ARRAY $Axes[] = {"B","C"}&lt;BR /&gt;INT LIST $Axes_Choices = INPUT CHOICE MULTIPLE $Axes "Choose which axes to add in the toolpath"&lt;/P&gt;&lt;P&gt;STRING Old_Name = INPUT "Que voulez-vous remplacer?"&lt;BR /&gt;//STRING New_Name = INPUT "Par quoi voulez-vous le remplacer?"&lt;BR /&gt;&lt;BR /&gt;FOREACH $tp IN $Toolpaths {&lt;BR /&gt;ACTIVATE TOOLPATH $tp.Name&lt;BR /&gt;REAL axisB = round(machine().B, 4)&lt;BR /&gt;REAL axisC = round(machine().C, 4)&lt;BR /&gt;STRING New_AxisB = "B" + "$axisB"&lt;BR /&gt;STRING New_AxisC = "C" + "$axisC"&lt;/P&gt;&lt;P&gt;FOREACH $Axes IN $Axes_Choices {&lt;BR /&gt;IF $Axes == 0 {&lt;BR /&gt;STRING NewNameB = replace(Name, '$Old_Name', '$New_AxisB')&lt;BR /&gt;RENAME TOOLPATH ; $NewNameB&lt;BR /&gt;} ELSEIF $Axes == 1 {&lt;BR /&gt;STRING NewNameC = replace(Name, '$Old_Name', '$New_AxisC')&lt;BR /&gt;RENAME TOOLPATH ; $NewNameC&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;DIALOGS ERROR ON&lt;BR /&gt;DIALOGS MESSAGE ON&lt;/P&gt;&lt;P&gt;MESSAGE INFO "TOOLPATHS MODIFIED"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;J.lacrasse&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 18:09:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8260961#M19298</guid>
      <dc:creator>j.lacrasse</dc:creator>
      <dc:date>2018-09-11T18:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8261112#M19299</link>
      <description>&lt;P&gt;&lt;SPAN class="short_text"&gt;&lt;SPAN class=""&gt;Userparameters should be a good idea.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;The only problem is the toolpaths that already contain B and C in the name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ENTITY LIST Toolpaths = INPUT ENTITY MULTIPLE TOOLPATH "Choose toolpaths to rename B and C axis"
FOREACH $tp IN $Toolpaths {
	ACTIVATE TOOLPATH $tp.name
	STRING TP_NAME = $tp.Name
	REAL axisB = round(machine().B, 4)
	REAL axisC = round(machine().C, 4)
	STRING New_AxisB = "B" + $axisB
	STRING New_AxisC = "C" + $axisC
	
	IF NOT Member($tp.userparameters._keys,"B_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "B_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
		$TP_NAME = $TP_NAME + " " + $New_AxisB
	}
	IF NOT Member($tp.userparameters._keys,"C_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "C_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
		$TP_NAME = $TP_NAME + " " + $New_AxisC
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
		CONTINUE
	}

	STRING Old_AxisB = $entity('toolpath';$tp.name).UserParameters.B_Axis
	STRING Old_AxisC = $entity('toolpath';$tp.name).UserParameters.C_Axis
	IF $Old_AxisB != $New_AxisB {
		$TP_NAME = replace($TP_NAME, $Old_AxisB, $New_AxisB)
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
	}
	IF $Old_AxisC != $New_AxisC {
		$TP_NAME = replace($TP_NAME, $Old_AxisC, $New_AxisC)
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
	}	
}
MESSAGE INFO "TOOLPATHS MODIFIED"&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Sep 2018 19:10:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8261112#M19299</guid>
      <dc:creator>rafael.sansao</dc:creator>
      <dc:date>2018-09-11T19:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8261202#M19300</link>
      <description>&lt;P&gt;Hi Rafael,&lt;/P&gt;&lt;P&gt;It seems to work great. But... I'd like the B and C to be written before all my OP.&amp;nbsp;&lt;/P&gt;&lt;P&gt;All my toolpaths end with OP1, OP2, etc...&lt;/P&gt;&lt;P&gt;Lastly, if there is any A,B or C axis already in my toolpath name, how can I erase/replace with the new axis without erasing something else?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;J.Lacrasse&lt;/P&gt;</description>
      <pubDate>Tue, 11 Sep 2018 19:48:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8261202#M19300</guid>
      <dc:creator>j.lacrasse</dc:creator>
      <dc:date>2018-09-11T19:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8261532#M19301</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;ENTITY LIST Toolpaths = INPUT ENTITY MULTIPLE TOOLPATH "Choose toolpaths to rename B and C axis"

FOREACH $tp IN $Toolpaths {
	ACTIVATE TOOLPATH $tp.name
	STRING TP_NAME = $tp.Name
	STRING LIST Tokens = tokens($tp.Name, " ")
	INT S_TOKEN = SIZE($Tokens) - 1
	
	REAL axisB = round(machine().B, 4)
	REAL axisC = round(machine().C, 4)
	STRING New_AxisB = "B" + $axisB
	STRING New_AxisC = "C" + $axisC
	
	IF NOT Member($tp.userparameters._keys,"B_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "B_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
		IF $S_TOKEN &amp;gt;= 3 {
			IF POSITION($Tokens[$S_TOKEN-1], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "C") &amp;gt; -1 {
				$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-1], "")
			}
			IF POSITION($Tokens[$S_TOKEN-2], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "C") &amp;gt; -1 {
				$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-2], "")
			}
			IF POSITION($Tokens[$S_TOKEN-3], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "C") &amp;gt; -1 {
				$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-3], "")
			}
		}
	}
	IF NOT Member($tp.userparameters._keys,"C_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "C_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
		IF POSITION($Tokens[$S_TOKEN], "OP") &amp;gt; -1 {
			$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN], "") + " " + $New_AxisB + " " + $New_AxisC + " " + $Tokens[$S_TOKEN]
		} ELSE {
			$TP_NAME = $TP_NAME + " " + $New_AxisB + " " + $New_AxisC
		}
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
		CONTINUE
	}

	STRING Old_AxisB = $entity('toolpath';$tp.name).UserParameters.B_Axis
	STRING Old_AxisC = $entity('toolpath';$tp.name).UserParameters.C_Axis
	IF $Old_AxisB != $New_AxisB {
		$TP_NAME = replace($TP_NAME, $Old_AxisB, $New_AxisB)
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
	}
	IF $Old_AxisC != $New_AxisC {
		$TP_NAME = replace($TP_NAME, $Old_AxisC, $New_AxisC)
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
	}	
}
MESSAGE INFO "TOOLPATHS MODIFIED"&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Sep 2018 23:11:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8261532#M19301</guid>
      <dc:creator>rafael.sansao</dc:creator>
      <dc:date>2018-09-11T23:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8262882#M19302</link>
      <description>&lt;P&gt;Hi Rafael, Wonderful macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only thing that didn't work is if the toolpath\userpameter existed, it just wouldn't replace the old axis with the new one. Is it ok to : If Member(etc...)?&lt;/P&gt;&lt;P&gt;And I guess I could remove the last part of the macro which is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;STRING Old_AxisB = $entity('toolpath';$tp.name).UserParameters.B_Axis&lt;BR /&gt;STRING Old_AxisC = $entity('toolpath';$tp.name).UserParameters.C_Axis&lt;BR /&gt;IF $Old_AxisB != $New_AxisB {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, $Old_AxisB, $New_AxisB)&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB&lt;BR /&gt;}&lt;BR /&gt;IF $Old_AxisC != $New_AxisC {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, $Old_AxisC, $New_AxisC)&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC&lt;BR /&gt;}&lt;BR /&gt;IF $tp.name != $TP_NAME {&lt;BR /&gt;RENAME TOOLPATH ; $TP_NAME&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So here is your macro with my mods.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DIALOGS ERROR OFF&lt;BR /&gt;DIALOGS MESSAGE OFF&lt;/P&gt;&lt;P&gt;ENTITY LIST Toolpaths = INPUT ENTITY MULTIPLE TOOLPATH "Choose toolpaths to rename B and C axis"&lt;/P&gt;&lt;P&gt;FOREACH $tp IN $Toolpaths {&lt;BR /&gt;ACTIVATE TOOLPATH $tp.name&lt;BR /&gt;SIMULATE TOOLPATH ;&lt;BR /&gt;STRING TP_NAME = $tp.Name&lt;BR /&gt;STRING LIST Tokens = tokens($tp.Name, " ")&lt;BR /&gt;INT S_TOKEN = SIZE($Tokens) - 1&lt;BR /&gt;&lt;BR /&gt;REAL axisB = round(machine().B, 4)&lt;BR /&gt;REAL axisC = round(machine().C, 4)&lt;BR /&gt;STRING New_AxisB = "B" + $axisB&lt;BR /&gt;STRING New_AxisC = "C" + $axisC&lt;BR /&gt;&lt;BR /&gt;IF NOT Member($tp.userparameters._keys,"B_Axis") {&lt;BR /&gt;EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'&lt;BR /&gt;EDIT USERPAR toolpath_strategy $tp.name NAME "B_Axis"&lt;BR /&gt;CREATE USERPAR toolpath_strategy $tp.name&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB&lt;BR /&gt;IF $S_TOKEN &amp;gt;= 3 {&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN-1], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "C") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-1], "")&lt;BR /&gt;}&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN-2], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "C") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-2], "")&lt;BR /&gt;}&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN-3], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "C") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-3], "")&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;IF NOT Member($tp.userparameters._keys,"C_Axis") {&lt;BR /&gt;EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'&lt;BR /&gt;EDIT USERPAR toolpath_strategy $tp.name NAME "C_Axis"&lt;BR /&gt;CREATE USERPAR toolpath_strategy $tp.name&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN], "OP") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN], "") + " " + $New_AxisB + " " + $New_AxisC + " " + $Tokens[$S_TOKEN]&lt;BR /&gt;} ELSE {&lt;BR /&gt;$TP_NAME = $TP_NAME + " " + $New_AxisB + " " + $New_AxisC&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;IF Member($tp.userparameters._keys,"B_Axis") {&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB&lt;BR /&gt;IF $S_TOKEN &amp;gt;= 3 {&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN-1], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "C") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-1], "")&lt;BR /&gt;}&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN-2], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "C") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-2], "")&lt;BR /&gt;}&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN-3], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "C") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-3], "")&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;IF Member($tp.userparameters._keys,"C_Axis") {&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC&lt;BR /&gt;IF POSITION($Tokens[$S_TOKEN], "OP") &amp;gt; -1 {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN], "") + " " + $New_AxisB + " " + $New_AxisC + " " + $Tokens[$S_TOKEN]&lt;BR /&gt;} ELSE {&lt;BR /&gt;$TP_NAME = $TP_NAME + " " + $New_AxisB + " " + $New_AxisC&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;IF $tp.name != $TP_NAME {&lt;BR /&gt;RENAME TOOLPATH ; $TP_NAME&lt;BR /&gt;CONTINUE&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;STRING Old_AxisB = $entity('toolpath';$tp.name).UserParameters.B_Axis&lt;BR /&gt;STRING Old_AxisC = $entity('toolpath';$tp.name).UserParameters.C_Axis&lt;BR /&gt;IF $Old_AxisB != $New_AxisB {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, $Old_AxisB, $New_AxisB)&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB&lt;BR /&gt;}&lt;BR /&gt;IF $Old_AxisC != $New_AxisC {&lt;BR /&gt;$TP_NAME = replace($TP_NAME, $Old_AxisC, $New_AxisC)&lt;BR /&gt;${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC&lt;BR /&gt;}&lt;BR /&gt;IF $tp.name != $TP_NAME {&lt;BR /&gt;RENAME TOOLPATH ; $TP_NAME&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;MESSAGE INFO "TOOLPATHS MODIFIED"&lt;/P&gt;&lt;P&gt;DIALOGS ERROR ON&lt;BR /&gt;DIALOGS MESSAGE ON&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last thing,&lt;/P&gt;&lt;P&gt;How to paste my macro in here with the right format? Should I post it as a picture?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;J.Lacrasse&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 13:16:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8262882#M19302</guid>
      <dc:creator>j.lacrasse</dc:creator>
      <dc:date>2018-09-12T13:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8262963#M19303</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The first &lt;SPAN class="short_text"&gt;section &lt;/SPAN&gt;of the macro clears the old values and inserts the user parameters for control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;	ACTIVATE TOOLPATH $tp.name
	STRING TP_NAME = $tp.Name
	STRING LIST Tokens = tokens($tp.Name, " ")
	INT S_TOKEN = SIZE($Tokens) - 1
	
	REAL axisB = round(machine().B, 4)
	REAL axisC = round(machine().C, 4)
	STRING New_AxisB = "B" + $axisB
	STRING New_AxisC = "C" + $axisC
	
	IF NOT Member($tp.userparameters._keys,"B_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "B_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
		IF $S_TOKEN &amp;gt;= 3 {
			IF POSITION($Tokens[$S_TOKEN-1], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "C") &amp;gt; -1 {
				$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-1], "")
			}
			IF POSITION($Tokens[$S_TOKEN-2], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "C") &amp;gt; -1 {
				$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-2], "")
			}
			IF POSITION($Tokens[$S_TOKEN-3], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "C") &amp;gt; -1 {
				$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-3], "")
			}
		}
	}
	IF NOT Member($tp.userparameters._keys,"C_Axis") {
		EDIT USERPAR toolpath_strategy $tp.name TYPE 'String'
		EDIT USERPAR toolpath_strategy $tp.name NAME "C_Axis"
		CREATE USERPAR toolpath_strategy $tp.name
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
		IF POSITION($Tokens[$S_TOKEN], "OP") &amp;gt; -1 {
			$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN], "") + " " + $New_AxisB + " " + $New_AxisC + " " + $Tokens[$S_TOKEN]
		} ELSE {
			$TP_NAME = $TP_NAME + " " + $New_AxisB + " " + $New_AxisC
		}
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
		CONTINUE
	}&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The second &lt;SPAN class="short_text"&gt;section &lt;/SPAN&gt;of the macro uses the user parameters to override the exists values.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;	STRING Old_AxisB = $entity('toolpath';$tp.name).UserParameters.B_Axis
	STRING Old_AxisC = $entity('toolpath';$tp.name).UserParameters.C_Axis
	IF $Old_AxisB != $New_AxisB {
		$TP_NAME = replace($TP_NAME, $Old_AxisB, $New_AxisB)
		${entity('toolpath';$tp.name).UserParameters.B_Axis} = $New_AxisB
	}
	IF $Old_AxisC != $New_AxisC {
		$TP_NAME = replace($TP_NAME, $Old_AxisC, $New_AxisC)
		${entity('toolpath';$tp.name).UserParameters.C_Axis} = $New_AxisC
	}
	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
	}	&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class="short_text"&gt;Both sections are required!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;&lt;SPAN class="short_text"&gt;User parameters will only exist if you run this macro. If you use another macro to rename the toolpaths, you must delete the user parameters (using this other macro)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 13:39:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8262963#M19303</guid>
      <dc:creator>rafael.sansao</dc:creator>
      <dc:date>2018-09-12T13:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263367#M19304</link>
      <description>&lt;P&gt;Hi Rafael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could you tell me why it doesn't work than?&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;J.Lacrasse&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="iframe-container"&gt;&lt;IFRAME width="640" height="590" src="https://screencast.autodesk.com/Embed/Timeline/5e10da75-e212-4267-9248-153e94715de4" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 15:44:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263367#M19304</guid>
      <dc:creator>j.lacrasse</dc:creator>
      <dc:date>2018-09-12T15:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263383#M19305</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="iframe-container"&gt;&lt;IFRAME width="640" height="590" src="https://screencast.autodesk.com/Embed/Timeline/5e10da75-e212-4267-9248-153e94715de4" frameborder="0" scrolling="no" allowfullscreen="allowfullscreen" webkitallowfullscreen="webkitallowfullscreen"&gt;&lt;/IFRAME&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 15:44:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263383#M19305</guid>
      <dc:creator>j.lacrasse</dc:creator>
      <dc:date>2018-09-12T15:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263495#M19306</link>
      <description>&lt;P&gt;The toolpath is not renamed because you changed the name manually.&lt;BR /&gt;To force data updates, try this:&lt;/P&gt;
&lt;PRE&gt;ENTITY LIST Toolpaths = INPUT ENTITY MULTIPLE TOOLPATH "Choose toolpaths to rename B and C axis"

FOREACH $tp IN $Toolpaths {
	ACTIVATE TOOLPATH $tp.name
	STRING TP_NAME = $tp.Name
	STRING LIST Tokens = tokens($tp.Name, " ")
	INT S_TOKEN = SIZE($Tokens) - 1
	
	REAL axisB = round(machine().B, 4)
	REAL axisC = round(machine().C, 4)
	STRING New_AxisB = "B" + $axisB
	STRING New_AxisC = "C" + $axisC
	
	IF $S_TOKEN &amp;gt;= 3 {
		IF POSITION($Tokens[$S_TOKEN-1], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-1], "C") &amp;gt; -1 {
			$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-1], "")
		}
		IF POSITION($Tokens[$S_TOKEN-2], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-2], "C") &amp;gt; -1 {
			$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-2], "")
		}
		IF POSITION($Tokens[$S_TOKEN-3], "A") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "B") &amp;gt; -1 OR POSITION($Tokens[$S_TOKEN-3], "C") &amp;gt; -1 {
			$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN-3], "")
		}
	}
	IF POSITION($Tokens[$S_TOKEN], "OP") &amp;gt; -1 {
		$TP_NAME = replace($TP_NAME, " " + $Tokens[$S_TOKEN], "") + " " + $New_AxisB + " " + $New_AxisC + " " + $Tokens[$S_TOKEN]
	} ELSE {
		$TP_NAME = $TP_NAME + " " + $New_AxisB + " " + $New_AxisC
	}

	IF $tp.name != $TP_NAME {
		RENAME TOOLPATH ; $TP_NAME
		CONTINUE
	}
}
MESSAGE INFO "TOOLPATHS MODIFIED"&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Sep 2018 16:34:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263495#M19306</guid>
      <dc:creator>rafael.sansao</dc:creator>
      <dc:date>2018-09-12T16:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Replace axis value in toolpath</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263593#M19307</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4163177"&gt;@rafael.sansao&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;J.Lacrasse&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 17:11:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/replace-axis-value-in-toolpath/m-p/8263593#M19307</guid>
      <dc:creator>j.lacrasse</dc:creator>
      <dc:date>2018-09-12T17:11:44Z</dc:date>
    </item>
  </channel>
</rss>

