<?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: Adding Prefix to Body Name in Inventor Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10431347#M104561</link>
    <description>&lt;P&gt;Excellent.&amp;nbsp;&lt;/P&gt;&lt;P&gt;also By changing the code slightly i could use this to rename existing bodies that are in different naming formats.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example i used "_" &amp;amp;&amp;nbsp; "space" to replace.&amp;nbsp; anyway great. thankyou.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jun 2021 06:42:00 GMT</pubDate>
    <dc:creator>Biju.Veedu</dc:creator>
    <dc:date>2021-06-30T06:42:00Z</dc:date>
    <item>
      <title>Adding Prefix to Body Name</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424069#M104558</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any ilOGIC rules avaiable to add prefix to all solid bodies in a multibody part file?&amp;nbsp; i want to retain the existing solidbody name with new prefix infront of it. thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jun 2021 12:11:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424069#M104558</guid>
      <dc:creator>Biju.Veedu</dc:creator>
      <dc:date>2021-06-27T12:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Prefix to Body Name</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424395#M104559</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8090910"&gt;@Biju.Veedu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below post are all duplicate post requesting the same thing.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/ilogic-rename-solid-bodies-all-to-select/m-p/10424083#M125901" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/ilogic-rename-solid-bodies-all-to-select/m-p/10424083#M125901&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424069" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424069&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/multi-bodies-auto-rename/m-p/10424080#M125900" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/multi-bodies-auto-rename/m-p/10424080#M125900&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly please avoid creating duplicate posts this can be very frustrating for users and will dilute the effectiveness of individual post. Secondly&amp;nbsp; it is better to create one post and link other post that explain your help request. Thirdly posting on solved posts is also not the best practice as user will assume they are solved and will pass over them.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For future post if they involve ilogic please post them here.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/bd-p/120" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/bd-p/120&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If possible include the code you are working with/attempted and an explanation of the problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below code is adapted from &lt;A href="https://forums.autodesk.com/t5/inventor-customization/multi-bodies-auto-rename/m-p/10105379/page/2" target="_blank" rel="noopener"&gt;here&lt;/A&gt; on post 20 0f 32&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;withString&lt;/SPAN&gt; = &lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Prompt"&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;, &lt;SPAN&gt;"Default Entry"&lt;/SPAN&gt;)
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;solid&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;
		&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;solid&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;
		&lt;SPAN&gt;myparams&lt;/SPAN&gt; = &lt;SPAN&gt;Name&lt;/SPAN&gt;.&lt;SPAN&gt;Split&lt;/SPAN&gt;(&lt;SPAN&gt;"-"&lt;/SPAN&gt;)
		&lt;SPAN&gt;replaceString1&lt;/SPAN&gt; = &lt;SPAN&gt;myparams&lt;/SPAN&gt;(0)
		&lt;SPAN&gt;'replaceString2 = myparams(1)&lt;/SPAN&gt;
		&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;Name&lt;/SPAN&gt;.&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;replaceString1&lt;/SPAN&gt;, &lt;SPAN&gt;withString&lt;/SPAN&gt;)
		&lt;SPAN&gt;solid&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;Name&lt;/SPAN&gt;
 	&lt;SPAN&gt;Next&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Jun 2021 17:43:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424395#M104559</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2021-06-27T17:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Prefix to Body Name</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424975#M104560</link>
      <description>&lt;P&gt;In a part file you can do this without code for all future solids under document settings&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gcoombridge_0-1624847414870.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/935041iE82C632A1C87C7AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gcoombridge_0-1624847414870.png" alt="gcoombridge_0-1624847414870.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Otherwise here is some code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Dim oDoc As PartDocument = ThisDoc.Document
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition

Dim oSolid As SurfaceBody
Dim oSolidName As String
Dim oPrefix As String = InputBox("Provide a prefix for each solid:", "Solid Body Prefix","")


'iterate through all solids and rename if default
For Each oSolid In oDef.SurfaceBodies
	oSolidName = oSolid.Name
	oSolid.Name = oPrefix &amp;amp; oSolidName
Next oSolid&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 28 Jun 2021 02:34:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10424975#M104560</guid>
      <dc:creator>gcoombridge</dc:creator>
      <dc:date>2021-06-28T02:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Prefix to Body Name</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10431347#M104561</link>
      <description>&lt;P&gt;Excellent.&amp;nbsp;&lt;/P&gt;&lt;P&gt;also By changing the code slightly i could use this to rename existing bodies that are in different naming formats.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example i used "_" &amp;amp;&amp;nbsp; "space" to replace.&amp;nbsp; anyway great. thankyou.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 06:42:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10431347#M104561</guid>
      <dc:creator>Biju.Veedu</dc:creator>
      <dc:date>2021-06-30T06:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Prefix to Body Name</title>
      <link>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10431354#M104562</link>
      <description>&lt;P&gt;Excellent. thankyou.&lt;/P&gt;&lt;P&gt;this code helped me to rename with a new prefix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the code for replacing an existing name that are seperated by "_"&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;withString&lt;/SPAN&gt; = &lt;SPAN&gt;InputBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Prompt"&lt;/SPAN&gt;, &lt;SPAN&gt;"Title"&lt;/SPAN&gt;, &lt;SPAN&gt;"Default Entry"&lt;/SPAN&gt;)
	&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;solid&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;SurfaceBodies&lt;/SPAN&gt;
		&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;solid&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt;
		&lt;SPAN&gt;myparams&lt;/SPAN&gt; = &lt;SPAN&gt;Name&lt;/SPAN&gt;.&lt;SPAN&gt;Split&lt;/SPAN&gt;(&lt;SPAN&gt;"_"&lt;/SPAN&gt;)
		&lt;SPAN&gt;replaceString1&lt;/SPAN&gt; = &lt;SPAN&gt;myparams&lt;/SPAN&gt;(0)
		&lt;SPAN&gt;'replaceString2 = myparams(1)&lt;/SPAN&gt;
		&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;Name&lt;/SPAN&gt;.&lt;SPAN&gt;Replace&lt;/SPAN&gt;(&lt;SPAN&gt;replaceString1&lt;/SPAN&gt;, &lt;SPAN&gt;withString&lt;/SPAN&gt;)
		&lt;SPAN&gt;solid&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;Name&lt;/SPAN&gt;
 	&lt;SPAN&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 06:46:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-forum/adding-prefix-to-body-name/m-p/10431354#M104562</guid>
      <dc:creator>Biju.Veedu</dc:creator>
      <dc:date>2021-06-30T06:46:19Z</dc:date>
    </item>
  </channel>
</rss>

