<?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: Import Manager Help in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/import-manager-help/m-p/8901987#M13869</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not related to the error message you mentioned, but replace the line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;stpFileName = 'C:\\Users\Phartman.hartprecision\Desktop\WAGDE-MB723291S-S.STEP'&lt;/PRE&gt;&lt;P&gt;With:&lt;/P&gt;&lt;PRE&gt;stpFileName = 'C:\\Users\\Phartman.hartprecision\\Desktop\\WAGDE-MB723291S-S.STEP&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Or:&lt;/P&gt;&lt;PRE&gt;stpFileName = r'C:\Users\Phartman.hartprecision\Desktop\WAGDE-MB723291S-S.STEP'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Or:&lt;/P&gt;&lt;PRE&gt;stpFileName = 'C:/Users/Phartman.hartprecision/Desktop/WAGDE-MB723291S-S.STEP'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2019 18:34:53 GMT</pubDate>
    <dc:creator>JeromeBriot</dc:creator>
    <dc:date>2019-07-10T18:34:53Z</dc:date>
    <item>
      <title>Import Manager Help</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/import-manager-help/m-p/8901896#M13868</link>
      <description>&lt;PRE&gt;import adsk.core, adsk.fusion, traceback
import os.path, sys

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        # Get import manager
        importManager = app.importManager
        


       # Get step import options
        stpFileName = 'C:\\Users\Phartman.hartprecision\Desktop\WAGDE-MB723291S-S.STEP'
        stpOptions = importManager.createSTEPImportOptions(stpFileName)
        stpOptions.isViewFit = False
        
        # Get active design
        product = app.activeProduct
        design = adsk.fusion.Design.cast(product)

        # Get root component
        rootComp = design.rootComponent
        
        
        # Import step file to root component
        importManager.importToTarget(stpOptions, rootComp)
    
       
        # Close the new created document
        doc = app.activeDocument
        doc.close(False)
        
    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;&lt;P&gt;&lt;U&gt;&lt;FONT&gt;SAMPLE CODE:&lt;/FONT&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-3f24e9e8-422d-11e5-937b-f8b156d7cd97" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-3f24e9e8-422d-11e5-937b-f8b156d7cd97&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to run the sample code from the link attached. Getting error "&lt;EM&gt;AttributeError: "NoneType" object has no attribute 'rootComponent'&lt;/EM&gt; . When uploading the file from my computer without the add-in it works fine. Why is this happening? Any would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 17:59:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/import-manager-help/m-p/8901896#M13868</guid>
      <dc:creator>TechrimStandards</dc:creator>
      <dc:date>2019-07-10T17:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Import Manager Help</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/import-manager-help/m-p/8901987#M13869</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not related to the error message you mentioned, but replace the line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;stpFileName = 'C:\\Users\Phartman.hartprecision\Desktop\WAGDE-MB723291S-S.STEP'&lt;/PRE&gt;&lt;P&gt;With:&lt;/P&gt;&lt;PRE&gt;stpFileName = 'C:\\Users\\Phartman.hartprecision\\Desktop\\WAGDE-MB723291S-S.STEP&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Or:&lt;/P&gt;&lt;PRE&gt;stpFileName = r'C:\Users\Phartman.hartprecision\Desktop\WAGDE-MB723291S-S.STEP'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Or:&lt;/P&gt;&lt;PRE&gt;stpFileName = 'C:/Users/Phartman.hartprecision/Desktop/WAGDE-MB723291S-S.STEP'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 18:34:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/import-manager-help/m-p/8901987#M13869</guid>
      <dc:creator>JeromeBriot</dc:creator>
      <dc:date>2019-07-10T18:34:53Z</dc:date>
    </item>
  </channel>
</rss>

