aconz2 / fusion360exporter Goto Github PK
View Code? Open in Web Editor NEWExport (and sync) all of your Fusion360 projects and documents in various formats
License: The Unlicense
Export (and sync) all of your Fusion360 projects and documents in various formats
License: The Unlicense
I got following error when trying to do full export:
Most probably this happens due to unsupported electronics file. I think those kind of documents could be excluded from export.
The log:
Visiting folder Admin Project
Visiting file beam3 v1 . f3d
Opening `beam3`
filename `Beam3:1` contained bad chars, replacing by `Beam3 1`
Exporting sketch Sketch2 in Beam3 to C:\Users\Rafal\Documents\drukarka3d\moje\backups\Fusion360Export\Admin Project\beam3 v1\Beam3 1_1d0f16fd\Sketch2.dxf
Exporting sketch Sketch1 in Beam3 to C:\Users\Rafal\Documents\drukarka3d\moje\backups\Fusion360Export\Admin Project\beam3 v1\Beam3 1_1d0f16fd\Sketch1.dxf
Saved C:\Users\Rafal\Documents\drukarka3d\moje\backups\Fusion360Export\Admin Project\beam3_v1.f3d
Saved C:\Users\Rafal\Documents\drukarka3d\moje\backups\Fusion360Export\Admin Project\beam3_v1.step
Saved C:\Users\Rafal\Documents\drukarka3d\moje\backups\Fusion360Export\Admin Project\beam3_v1.igs
Closing beam3
...
Visiting file electornics_playground v1 . fbrd
Opening `electornics_playground`
PS: Great tool!
Store the last-run settings in a json file next to the __file__
location.
Also can store user created preset settings and display them in a table
The scripts appear to have been written against Python 3.7. The version of Fusion360 I am running (2.0.3706) ships with Python 3.5. I thought Fusion360 auto updated, but now I'm not sure, and finding what the latest version isn't easy, and I can't see where to d/l a new version.
A little more info from Fusion360:
import sys
sys.version
3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 08:49:46) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
I'm not sure where 3.5.3 is coming from, as I only have 3.4, 3.6, 3.7 installed locally.
Also, dataclasses was added in 3.7 (https://docs.python.org/3/library/dataclasses.html) which explains why it fails w/ Python 3.5.
I've made a number of changes to make it Python 3.5 compatible, but now I'm not sure how to handle NamedTuple:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/jmg/github/Fusion360Exporter/foo.py", line 5, in test
exec(data)
File "<string>", line 41, in <module>
File "/Users/jmg/Library/Application Support/Autodesk/webdeploy/production/1d09d44697aca8134bfd0a02c1326040d3faf96a/Autodesk Fusion 360.app/Contents/Frameworks/Python.framework/Versions/Current/lib/python3.5/typing.py", line 1916, in __new__
raise TypeError("Class syntax for NamedTuple is only supported"
TypeError: Class syntax for NamedTuple is only supported in Python 3.6+
I'm using this module:
def test():
with open('/Users/jmg/github/Fusion360Exporter/Exporter.py') as fp:
data = fp.read()
exec(data)
To be able to get useful error messages from Fusion360.
Trying to export all formats:
---------------------------
Fusion 360
---------------------------
Log file is at H:\Fusion360Export\2020_09_21_18_04.txt
Traceback (most recent call last):
File "C:/Users/giacomo/Desktop/Fusion360Exporter-master/Exporter.py", line 232, in visit_folder
counter += visit_file(new_ctx, file)
File "C:/Users/giacomo/Desktop/Fusion360Exporter-master/Exporter.py", line 211, in visit_file
doc.open()
File "C:/Users/giacomo/Desktop/Fusion360Exporter-master/Exporter.py", line 63, in open
self._document = self._ctx.app.documents.open(self._file)
File "C:/Users/giacomo/AppData/Local/Autodesk/webdeploy/production/4143a7d9c7cd58a0f86968fd3809be3e34945ca1/Api/Python/packages\adsk\core.py", line 7295, in open
return _core.Documents_open(self, *args)
RuntimeError: 3 : Failed to download file.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:/Users/giacomo/Desktop/Fusion360Exporter-master/Exporter.py", line 235, in visit_folder
counter += visit_folder(new_ctx, sub_folder)
SystemError: <built-in function delete_DataFiles> returned a result with an error set
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:/Users/giacomo/Desktop/Fusion360Exporter-master/Exporter.py", line 247, in main
counter += visit_folder(ctx, project.rootFolder)
SystemError: <built-in function delete_DataFolders> returned a result with an error set
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:/Users/giacomo/Desktop/Fusion360Exporter-master/Exporter.py", line 313, in notify
counter = main(ctx)
SystemError: <built-in function delete_DataProjects> returned a result with an error set
---------------------------
OK
---------------------------
Glad to find this script, works better than the plugin I was using that failed on several things.
I have several large projects with lots of subfolders. Often I only do work in a subfolder but to "backup" using this script, I can only backup the entire project. Having subfolder selection ability on the startup dialog would be great.
I now see there is some incremental functionality, suppose that will do meanwhile.
From ...\Desktop\Fusion360Export\2020_09_22_15_56.txt:
Visiting file Cache_S8 v5 . f3d
Opening Cache_S8
Traceback (most recent call last):
File "D:/Mes_Documents/documents/Temp/Exporter.py", line 216, in visit_file
counter += export_file(ctx, format, file, doc)
File "D:/Mes_Documents/documents/Temp/Exporter.py", line 184, in export_file
options = em.createFusionArchiveExportOptions(str(output_path))
File "C:/Users/yves/AppData/Local/Autodesk/webdeploy/production/4143a7d9c7cd58a0f86968fd3809be3e34945ca1/Api/Python/packages\adsk\fusion.py", line 13016, in createFusionArchiveExportOptions
return _fusion.ExportManager_createFusionArchiveExportOptions(self, *args)
RuntimeError: 3 : The selected folder does not exist.
Should I create a folder before exporting ??
Please let me know what I am doing wrong
FWIW: Windows 10 (France)
Designs with forward-slashes in their name (e.g. "Loc-line 1/2 inch cup") fail to export with this error message:
Visiting file Canon MT-24EX 1/2 inch Loc-line foot v10 . f3d
Opening Canon MT-24EX 1/2 inch Loc-line foot
Traceback (most recent call last):
File "/Users/nick/Downloads/Fusion360Exporter-master/Exporter.py", line 125, in visit_file
counter += export_file(ctx, format, file, doc)
File "/Users/nick/Downloads/Fusion360Exporter-master/Exporter.py", line 103, in export_file
options = em.createFusionArchiveExportOptions(str(output_path))
File "/Users/nick/Library/Application Support/Autodesk/webdeploy/production/be6edacd6545d1f4fb1c9284e555a36b1cd1b40c/Autodesk Fusion 360.app/Contents/Api/Python/packages/adsk/fusion.py", line 11325, in createFusionArchiveExportOptions
return _fusion.ExportManager_createFusionArchiveExportOptions(self, *args)
RuntimeError: 3 : The selected folder does not exist.
Maybe slashes could be replaced by "-" signs?
Thanks for writing this script, it's awesome!
This is a great script.
Would it be possible to export the STL files as ASCII instead of binary?
Thank you.
The name path of a project needs to be sanitized. I have a project name with a slash (/) in it.
I hacked in sanitize_filename()
at new_ctx = ctx._replace(folder=ctx.folder / folder.name)
and it seems to be running OK for me now. Can't give a patch atm, as the export is running x).
edit. There might be an issue with folders inside projects as well (although I don't think I have any with odd characters).
Hello, I tried installing this twice ...
downloaded zip file
extracted to a directory
went to add-ins, scripts and add-ins, selected add-ins, clicked the green + sign, pasted the name of the extracted directory
clicked select folder and then nothing
Fusion 360 updated September 26th
Thank you for making this script available to all of us. I have used your Fusion360Expoter several times. It appears to work flawlessly. For me it is limited as it only exports the most recent version of any file. It would be MOST helpful if the script could be expanded with a feature, (selectable), to export all of the versions for individual files. If you are interested in visiting this script again, perhaps folders within projects could be selected for export. This would allow someone to export more selectively.
Currently all my drawings are being skipped. Sample log:
Visiting file CasterMountBlockDrawing v1 . f2d
file CasterMountBlockDrawing has extension f2d which is not currently handled, skipping
Can you add f2d to the export please? Those are a PITA to create, be nice to have them backed up too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.