<?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: Problem with createForAssemblyContext in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5943075#M20541</link>
    <description>&lt;P&gt;Is there any way to handle linked models with the API?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Dec 2015 08:53:32 GMT</pubDate>
    <dc:creator>grakoczy</dc:creator>
    <dc:date>2015-12-09T08:53:32Z</dc:date>
    <item>
      <title>Problem with createForAssemblyContext</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5935814#M20538</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With some scenes I have error when calling createForAssemblyContext function.&lt;/P&gt;&lt;P&gt;I got error: "The object has been in root component."&lt;/P&gt;&lt;P&gt;This is how my code looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;for occ in rootComp.allOccurrences:
    if occ.isVisible:
         comp = occ.component
         for body in comp.bRepBodies:
                b = body.createForAssemblyContext(occ)&lt;/PRE&gt;&lt;P&gt;assemblyContext for such bodies returns None.&lt;/P&gt;&lt;P&gt;Is there any way to fix this issue? Maybe different way of getting bRepBodies?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Grzegorz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 09:20:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5935814#M20538</guid>
      <dc:creator>grakoczy</dc:creator>
      <dc:date>2015-12-04T09:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with createForAssemblyContext</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5937201#M20539</link>
      <description>&lt;P&gt;That code should not ever fail with that (admittedly bad syntax) error. &amp;nbsp;Normally, you should only see that error if you are attempting to createForAssemblyContext on a body that is in the root component's bodies collection (not in an occurrence). &amp;nbsp;So it should be a bug in the API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can run that code in various assemblies that I have without seeing that error. &amp;nbsp;Can you post a document that demonstrates this, or detail exactly how to build an assembly that deomonstrates this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2015 02:01:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5937201#M20539</guid>
      <dc:creator>KrisKaplan</dc:creator>
      <dc:date>2015-12-05T02:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with createForAssemblyContext</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5937511#M20540</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2228534"&gt;@KrisKaplan﻿&lt;/a&gt;&amp;nbsp;Please send me an email at: info@ckbrd.de &amp;nbsp;I made that file for the plug-in developer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will send you my Fusion 360 log-in data so you can take a look at it directly inside my account.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I made two furniture models as separate files&lt;/P&gt;
&lt;P&gt;then I made a new file for the space and linked in the other two models.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With linked in models often parts are missplaced for the chairs when I made copies of the linked in model in the studio file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I broke the link oddly also the table had multiple copies - this time the chairs remained at their original position.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Claas&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2015 15:01:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5937511#M20540</guid>
      <dc:creator>cekuhnen</dc:creator>
      <dc:date>2015-12-05T15:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with createForAssemblyContext</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5943075#M20541</link>
      <description>&lt;P&gt;Is there any way to handle linked models with the API?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 08:53:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5943075#M20541</guid>
      <dc:creator>grakoczy</dc:creator>
      <dc:date>2015-12-09T08:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with createForAssemblyContext</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5944680#M20542</link>
      <description>&lt;P&gt;Ah. &amp;nbsp;There is the problem. &amp;nbsp;There is an error check intended to prevent objects in the root component from being used as an object for createForAssemblyContext. &amp;nbsp;And this check is incorrectly not allowing objects directly owned by the root component of a linked design to be used with createForAssemblyContext. &amp;nbsp;So in your example, this will fail if there are root level bodies in a linked design component. &amp;nbsp;I will file a bug on this and it should be fixed in the next major update (likely the latter half of January).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no way to force the assembly context Body to be created for bodies in the root of linked component designs. &amp;nbsp;If you only need the assembly context body to get transformed results (e.g. from meshes obtained from the body), then the workaround would be to use the transform from the occurrence with the geometry obtained from the native body and manually transform all results. &amp;nbsp;I understand this would be very inconvenient if your code is only expecting assembly context objects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kris&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 22:41:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5944680#M20542</guid>
      <dc:creator>KrisKaplan</dc:creator>
      <dc:date>2015-12-09T22:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with createForAssemblyContext</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5945265#M20543</link>
      <description>&lt;P&gt;Thanks, getting transform from occurence seems to work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 10:27:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/problem-with-createforassemblycontext/m-p/5945265#M20543</guid>
      <dc:creator>grakoczy</dc:creator>
      <dc:date>2015-12-10T10:27:02Z</dc:date>
    </item>
  </channel>
</rss>

