<?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: Re-naming created body with API? in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/re-naming-created-body-with-api/m-p/10827834#M7201</link>
    <description>&lt;P&gt;Simply use the BRepBody.name method, you can find the documentation &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-1b7c87de-2142-48c3-9dbf-668b710e7e3d" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;In your case, you probably need to do something along those lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;thickenFeature = thickenFeatures.add(thickenFeatureInput)
thickenedBody = thickenFeature.bodies.item(0) #Assuming only one body is created/modified through this feature
thickenedBody.name = 'Name of the body'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Dec 2021 19:55:45 GMT</pubDate>
    <dc:creator>tykapl.breuil</dc:creator>
    <dc:date>2021-12-16T19:55:45Z</dc:date>
    <item>
      <title>Re-naming created body with API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/re-naming-created-body-with-api/m-p/10827803#M7200</link>
      <description>&lt;P&gt;Hi everyone! I have been able to find some resources on renaming components with the API, but no luck finding anything for renaming bodies. Is this possible? The Add-On our team is working on creates a new body via a 0mm offset and then a 3mm thicken, but the body is named something arbitrary like 'body456' - is there any way to choose what this name will be, or edit it after creating?&lt;BR /&gt;&lt;BR /&gt;Thank you so much in advance for your help / insight!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; '''

                    Offset Feature

                '''

                # Create input entities for offset feature
                inputEntities = adsk.core.ObjectCollection.create()
                for face in faces:
                    inputEntities.add(face)

                # Distance for offset feature
                distance = adsk.core.ValueInput.createByString('0 mm')

                # Create an input for offset feature
                offsetFeatures = features.offsetFeatures
                offsetInput = offsetFeatures.createInput(
                    inputEntities, distance, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)

                # Create the offset feature
                # offsetFeatures.add(offsetInput)
                offsetBody = offsetFeatures.add(offsetInput)

                '''

                    Thicken Feature

                '''

                # Create the thicken feature
                thickenFeatures = features.thickenFeatures
                inputSurfaces = adsk.core.ObjectCollection.create()
                thickenFaces = offsetBody.faces
                for face in thickenFaces:
                    inputSurfaces.add(face)
                thickness = adsk.core.ValueInput.createByString('3 mm')
                thickenInput = thickenFeatures.createInput(
                    inputSurfaces, thickness, False, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
                thickenedBody = thickenFeatures.add(thickenInput)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 19:39:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/re-naming-created-body-with-api/m-p/10827803#M7200</guid>
      <dc:creator>knightsAHN63</dc:creator>
      <dc:date>2021-12-16T19:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re-naming created body with API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/re-naming-created-body-with-api/m-p/10827834#M7201</link>
      <description>&lt;P&gt;Simply use the BRepBody.name method, you can find the documentation &lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-1b7c87de-2142-48c3-9dbf-668b710e7e3d" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;In your case, you probably need to do something along those lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;thickenFeature = thickenFeatures.add(thickenFeatureInput)
thickenedBody = thickenFeature.bodies.item(0) #Assuming only one body is created/modified through this feature
thickenedBody.name = 'Name of the body'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 19:55:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/re-naming-created-body-with-api/m-p/10827834#M7201</guid>
      <dc:creator>tykapl.breuil</dc:creator>
      <dc:date>2021-12-16T19:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Re-naming created body with API?</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/re-naming-created-body-with-api/m-p/10836102#M7202</link>
      <description>&lt;P&gt;Worked like a charm! Thank you so much!!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 15:33:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/re-naming-created-body-with-api/m-p/10836102#M7202</guid>
      <dc:creator>knightsAHN63</dc:creator>
      <dc:date>2021-12-21T15:33:21Z</dc:date>
    </item>
  </channel>
</rss>

