<?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 Problem when changing material of component from Fusion 360 API in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12750145#M1468</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I'm developing an Autodesk Fusion AddIn, which allows &lt;STRONG&gt;changing the material&lt;/STRONG&gt; of components programmatically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I'm experiencing some problems when actually performing this operation on components that &lt;STRONG&gt;have been moved from their original position&lt;/STRONG&gt;, inside an assembly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For example in this design:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alessandro_sgreva_0-1714722628522.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1357810i6A68BDB76C5E9C65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alessandro_sgreva_0-1714722628522.png" alt="alessandro_sgreva_0-1714722628522.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have 3 copies of a golden component, inside the assembly, which have been moved to 3 different positions.&lt;/P&gt;&lt;P&gt;If I try to change the component material to&amp;nbsp;&lt;STRONG&gt;steel&lt;/STRONG&gt; using the following code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alessandro_sgreva_1-1714722793050.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1357814iBA90C4C92677736E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alessandro_sgreva_1-1714722793050.png" alt="alessandro_sgreva_1-1714722793050.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The material correctly changes, but for some reason the position of the three components is &lt;STRONG&gt;reset to the original create position&lt;/STRONG&gt; (they are all overlapped in the following image).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alessandro_sgreva_2-1714722870911.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1357816i6F7BE22B9FC4D72A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alessandro_sgreva_2-1714722870911.png" alt="alessandro_sgreva_2-1714722870911.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there something I'm doing wrong or is this an API bug?&lt;/P&gt;&lt;P&gt;This does not happen if I perform the material change manually from the Fusion 360 editor.&lt;/P&gt;</description>
    <pubDate>Fri, 03 May 2024 07:57:42 GMT</pubDate>
    <dc:creator>alessandro_sgreva</dc:creator>
    <dc:date>2024-05-03T07:57:42Z</dc:date>
    <item>
      <title>Problem when changing material of component from Fusion 360 API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12750145#M1468</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm developing an Autodesk Fusion AddIn, which allows &lt;STRONG&gt;changing the material&lt;/STRONG&gt; of components programmatically.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I'm experiencing some problems when actually performing this operation on components that &lt;STRONG&gt;have been moved from their original position&lt;/STRONG&gt;, inside an assembly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For example in this design:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alessandro_sgreva_0-1714722628522.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1357810i6A68BDB76C5E9C65/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alessandro_sgreva_0-1714722628522.png" alt="alessandro_sgreva_0-1714722628522.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have 3 copies of a golden component, inside the assembly, which have been moved to 3 different positions.&lt;/P&gt;&lt;P&gt;If I try to change the component material to&amp;nbsp;&lt;STRONG&gt;steel&lt;/STRONG&gt; using the following code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alessandro_sgreva_1-1714722793050.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1357814iBA90C4C92677736E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alessandro_sgreva_1-1714722793050.png" alt="alessandro_sgreva_1-1714722793050.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The material correctly changes, but for some reason the position of the three components is &lt;STRONG&gt;reset to the original create position&lt;/STRONG&gt; (they are all overlapped in the following image).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alessandro_sgreva_2-1714722870911.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1357816i6F7BE22B9FC4D72A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alessandro_sgreva_2-1714722870911.png" alt="alessandro_sgreva_2-1714722870911.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there something I'm doing wrong or is this an API bug?&lt;/P&gt;&lt;P&gt;This does not happen if I perform the material change manually from the Fusion 360 editor.&lt;/P&gt;</description>
      <pubDate>Fri, 03 May 2024 07:57:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12750145#M1468</guid>
      <dc:creator>alessandro_sgreva</dc:creator>
      <dc:date>2024-05-03T07:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when changing material of component from Fusion 360 API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12752794#M1469</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;can you please provide the code necessary for me to be able debug the add-in myself?&lt;BR /&gt;&lt;BR /&gt;I'm short on time (and lazy) to write the add-in to test it on my own to determine if that's issue of the API or there's some mistake in your code. C++ is fine.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 17:37:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12752794#M1469</guid>
      <dc:creator>j4n.vokurka</dc:creator>
      <dc:date>2024-05-04T17:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when changing material of component from Fusion 360 API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12753133#M1470</link>
      <description>&lt;P&gt;I don't think assigning a material should cause this since that's not a parametric operation, but your symptom is the same as when you do something in the API that would have caused this dialog to appear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BrianEkins_0-1714868848045.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1358318i773A2CD839A1ECC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BrianEkins_0-1714868848045.png" alt="BrianEkins_0-1714868848045.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;By default, the positions will be reverted. If you want to keep the position, you'll need to capture their positions before you make the change. You can use the code below. Try adding that to your program before you assign the material and see if that helps.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;des.snapshots.add()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you're still having problems, we'll need a simple test case that demonstrates the issue.&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 00:30:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12753133#M1470</guid>
      <dc:creator>BrianEkins</dc:creator>
      <dc:date>2024-05-05T00:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem when changing material of component from Fusion 360 API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12754738#M1471</link>
      <description>&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;P&gt;Adding the line of code you suggested before the material-changing logic seems to prevent this problem from happening.&lt;/P&gt;&lt;P&gt;I'll mark your suggestion as solution&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 07:18:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-when-changing-material-of-component-from-fusion-360-api/m-p/12754738#M1471</guid>
      <dc:creator>alessandro_sgreva</dc:creator>
      <dc:date>2024-05-06T07:18:58Z</dc:date>
    </item>
  </channel>
</rss>

