<?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: Insert Design into current Design in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/insert-design-into-current-design/m-p/6862707#M18641</link>
    <description>&lt;P&gt;Found an scripting example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/AutodeskFusion360/InsertExternalComponent" target="_blank"&gt;https://github.com/AutodeskFusion360/InsertExternalComponent&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Feb 2017 13:57:02 GMT</pubDate>
    <dc:creator>Jonschke</dc:creator>
    <dc:date>2017-02-08T13:57:02Z</dc:date>
    <item>
      <title>Insert Design into current Design</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/insert-design-into-current-design/m-p/6862562#M18640</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;i´m new to the Fusion 360 Scripting interface and i dug through the objecttree but i couldnt find a method to insert a design into the current document. In the screenshot you can see what i want to accomplish with the scripting interface.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 13:26:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/insert-design-into-current-design/m-p/6862562#M18640</guid>
      <dc:creator>Jonschke</dc:creator>
      <dc:date>2017-02-08T13:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Design into current Design</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/insert-design-into-current-design/m-p/6862707#M18641</link>
      <description>&lt;P&gt;Found an scripting example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/AutodeskFusion360/InsertExternalComponent" target="_blank"&gt;https://github.com/AutodeskFusion360/InsertExternalComponent&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 13:57:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/insert-design-into-current-design/m-p/6862707#M18641</guid>
      <dc:creator>Jonschke</dc:creator>
      <dc:date>2017-02-08T13:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Insert Design into current Design</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/insert-design-into-current-design/m-p/6863791#M18642</link>
      <description>&lt;P&gt;Here's a smaller, simpler script that demonstrates the process. &amp;nbsp;It's essentially the same as in the UI; you need to find the specific file on A360 by going to the project, and any subfolders, and then insert it into the active design. &amp;nbsp;The active design must have been saved at some point or the insert will fail, just like in the UI. &amp;nbsp;In this example, it's placing the file named "Bookshelf" that exists at the top level of the active project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import adsk.core, adsk.fusion, traceback

_app = adsk.core.Application.cast(None)
_ui  = adsk.core.UserInterface.cast(None)

def run(context):
    try:
        global _app, _ui
        _app = adsk.core.Application.get()
        _ui = _app.userInterface

        project = _app.data.activeProject
        bookshelfFile = None
        for file in project.rootFolder.dataFiles:
            if file.name == 'Bookshelf':
                bookshelfFile = file
                break

        des = adsk.fusion.Design.cast(_app.activeProduct)
        root = des.rootComponent
        occ = root.occurrences.addByInsert(bookshelfFile, adsk.core.Matrix3D.create(), True)            
    except:
        if _ui:
            _ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Feb 2017 19:07:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/insert-design-into-current-design/m-p/6863791#M18642</guid>
      <dc:creator>ekinsb</dc:creator>
      <dc:date>2017-02-08T19:07:01Z</dc:date>
    </item>
  </channel>
</rss>

