
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i am taking an autodesk course "develop an App for 3d design automation" and i am stuck at lab 3 where i have to import a file.. here is my code it give no error but no file opens in fusion 360.. i took this code from api samples and i have a file at location specified in the code.
any help is appreciated thankyou very much !
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 active design
product = app.activeProduct
design = adsk.fusion.Design.cast(product)
# Get root component
rootComp = design.rootComponent
# Get archive import options
archiveFileName = 'C:\Users\jamal\Desktop\fusion 360 codes\import pulley\\gt2pulley.f3d'
archiveOptions = importManager.createFusionArchiveImportOptions(archiveFileName)
# Import archive file to root component
importManager.importToTarget(archiveOptions, rootComp)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
Solved! Go to Solution.