Message 1 of 3
Fusion crashing after importing file from local storage(.f3d)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
def ImportFile(input_data: dict) -> dict:
'''
input_data = {"fileName": <fileName>}
output_data = {"status": <True/False>, "message": <message>}
'''
try:
# Extract the file name from input_data
fileName = input_data["fileName"]
# Check if file exists
if not os.path.isfile(fileName):
return {"status": False, "message": f"File '{fileName}' does not exist."}
# Get the application object
app = adsk.core.Application.get()
design = adsk.fusion.Design.cast(app.activeProduct)
# Get the root component of the active design (assembly)
rootComp = design.rootComponent
# Get import manager
importManager = app.importManager
# Get archive import options
archiveOptions = importManager.createFusionArchiveImportOptions(fileName)
# Log before importing
print(f"Attempting to import '{fileName}'...")
# Import the archive file into the current assembly
importManager.importToTarget(archiveOptions, rootComp)
doc = app.activeDocument
doc.close(False)
return {"status": True, "message": f"File '{fileName}' imported successfully into the assembly."}
except Exception as e:
return {"status": False, "message": f"Failed to import file: {traceback.format_exc()}"}
I am trying to import f3d file from local storage into fusion active document, but fusion app gets crashed