<?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: Solid-Body renaming in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/solid-body-renaming/m-p/12678088#M165662</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13402813"&gt;@autodesk0343ART&lt;/a&gt;&amp;nbsp;.&amp;nbsp;Please try this iLogic code:&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Sub Main()
	Dim oInvApp As Inventor.Application = ThisApplication
	Dim oPDoc As PartDocument = TryCast(oInvApp.ActiveDocument, PartDocument)
	If oPDoc Is Nothing Then Exit Sub
	Dim oBodies As SurfaceBodies = oPDoc.ComponentDefinition.SurfaceBodies
	If oBodies.Count = 0 Then Exit Sub
	Do
		Dim oBody As SurfaceBody
		Dim sName As String
		sName = InputBox("Please enter the name of the body.", "Rename body", "Body123")
		If String.IsNullOrEmpty(sName) Then Exit Sub
		oBody = oInvApp.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Select Body...")
		If oBody Is Nothing Then Exit Sub
		Try
			oBody.Name = sName
		Catch
			MessageBox.Show("Fail rename body.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
		End Try
	Loop
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Apr 2024 05:26:32 GMT</pubDate>
    <dc:creator>Andrii_Humeniuk</dc:creator>
    <dc:date>2024-04-01T05:26:32Z</dc:date>
    <item>
      <title>Solid-Body renaming</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/solid-body-renaming/m-p/12677622#M165659</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a solid renaming rule that works as follows:&lt;BR /&gt;In a multi-body environment, I would like a form window to pop up and in it I would have the option to enter the name of a solid and then after clicking on the solid the name would be assigned to it. On the other hand, after pressing the "esc" button, nothing would happen.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 31 Mar 2024 20:32:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/solid-body-renaming/m-p/12677622#M165659</guid>
      <dc:creator>autodesk0343ART</dc:creator>
      <dc:date>2024-03-31T20:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Solid-Body renaming</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/solid-body-renaming/m-p/12678088#M165662</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13402813"&gt;@autodesk0343ART&lt;/a&gt;&amp;nbsp;.&amp;nbsp;Please try this iLogic code:&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Public Sub Main()
	Dim oInvApp As Inventor.Application = ThisApplication
	Dim oPDoc As PartDocument = TryCast(oInvApp.ActiveDocument, PartDocument)
	If oPDoc Is Nothing Then Exit Sub
	Dim oBodies As SurfaceBodies = oPDoc.ComponentDefinition.SurfaceBodies
	If oBodies.Count = 0 Then Exit Sub
	Do
		Dim oBody As SurfaceBody
		Dim sName As String
		sName = InputBox("Please enter the name of the body.", "Rename body", "Body123")
		If String.IsNullOrEmpty(sName) Then Exit Sub
		oBody = oInvApp.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Select Body...")
		If oBody Is Nothing Then Exit Sub
		Try
			oBody.Name = sName
		Catch
			MessageBox.Show("Fail rename body.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error)
		End Try
	Loop
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 05:26:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/solid-body-renaming/m-p/12678088#M165662</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2024-04-01T05:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Solid-Body renaming</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/solid-body-renaming/m-p/12680104#M165694</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13518190"&gt;@Andrii_Humeniuk&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Great, exactly what I needed. Thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 02:31:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/solid-body-renaming/m-p/12680104#M165694</guid>
      <dc:creator>autodesk0343ART</dc:creator>
      <dc:date>2024-04-02T02:31:15Z</dc:date>
    </item>
  </channel>
</rss>

