aconz2/Fusion360Exporter
关于
以多种格式导出并同步所有 Fusion 360 项目和文档。
其他项目实测星标增长
- 24小时
- +1
- 7天
- +5
- 15天
- +5
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文This is a Fusion 360 Script to bulk export your files. Can export:
f3dfiles tof3d,igs,stp,smt,sat,3mfandstlf2dfiles topdf- can export drawings to
dxf
Installation
- Download this repo and unzip it somewhere.
- In Fusion, goto UTILITIES > ADD-INS > Scripts and Add-Ins (or just hit Shift+S)
- UTILITIES was previously known as TOOLS
- Next to "My Scripts", hit the green plus icon
- Select the folder where you unzipped it
- "Exporter" should now appear under "My Scripts"
or see the offical docs though they recommend copying the folder into the scripts directory and restarting which seems more complicated to me.
Versions
Released versions are tagged with YYYYMMDD.N and can be found in the tags page
Usage
- Goto Scripts and Add-Ins
- Select Exporter from "My Scripts"
- Hit Run. It will take a second to display the options panel as it is fetching your list of projects.
- After selecting your options and hitting okay, your computer will be unusable. The script will be potentially opening and exporting a lot of documents and each time it opens one, Fusion likes to make itself the active window which means you can't just have this run in the background (as far as I know).
Options
- Directory: This defaults to a folder called Fusion360Exports on your desktop
- File types: Select the export file types you want for each file. See File Types
- Download Open Folder: Uses the current folder in the Data Panel as the starting folder to initiate an export. See Projects/Folders
- Projects: Select the projects (or folders) you want to operate on
- Show Project Folders: Instead of selecting whole projects, you can select specific folders. See Projects/Folders
- Unhide All Bodies: Controls whether hidden components/bodies are made visible before exporting (they are excluded from every format except
f3dotherwise):- [no] Do not unhide: export only what is visible
- [yes] Unhide all bodies in the export: unhide all components and all bodies (recursively) so the single exported file contains all bodies
- [both] Also save a separate export with all bodies unhidden (if any are hidden): exports each non-
f3dformat twice, once as-is (model_v3.stp) and once with all bodies unhidden (model_v3_all_bodies.stp). If the model has no hidden bodies, the extra file is skipped
- Export Sketches as DXF: Each sketch will get exported as dxf
- Versions: Control how many versions are exported. See Versions
- Version Separator Is Space: Controls which character
_or(space) is used between the name and version (ie.name_v42.stlorname v42.stl). Defaults to the original_and checking this will use(space) to better match Fusion. - Export Non-Design Files: If true, all non-design files will be exported. Note that only the latest version will be exported and the version number will not be appended.
- Subfolder Per Model: If true, each model's exports (all formats, versions and sketches) are saved in their own folder named after the model, ie.
<export directory>/<project name>/<document name>/<document name><version separator><version name>.<file extension>. Files already exported without this option are not detected, so toggling it re-exports everything into the new layout. - Save Mesh Bodies as STL: Exports each mesh body as a STL. See Save Mesh Bodies.
The last run's settings are loaded by default (if they exist). They are stored next to the Exporter.py file on your file system in a file called last_settings.json. In "My Scripts", you can right-click "Exporter" and then "Open file location" to get there. If you rename projects or folders you will have to reselect those projects.
File Types
To export f2d files as pdf (this is the only available option; they cannot be downloaded as f2d), select PDF for the export type.
All other file types apply to f3d.
Projects/Folders
If Download Open Folder is selected, the files will be saved with all parent folders created to match the structure in Fusion. For example, if A/B/C is the active folder, then we export everything in and beneath folder C and those get saved on your computer as <export directory>/A/B/C/<file name etc>
By default, selecting a project from Export Projects will go through every file in every folder recursively.
If you enable Show Project Folders, the Export Projects dropdown is populated with the top level folders (with an additional <root>) of each project. Selecting the <root> folder visits files in the project's root folder, but does not recurse. Selecting any other folder will visit all the files in that folder AND recurse into it.
Versions
By default, only the latest version of each file will be exported. You can change this behavior to either
- save all versions
- save the previous
nversions. (n=0corresponds to the default because0additional versions are saved)
Operation
For each document in each selected project, it will check that there is a file named <export directory>/<project name>/<document name><version separator><version name>.<file extension> OR that file name with a few compressed/archived suffixes (see the code). If that file does not exist, it will open the document and do an export of it, then close it. If there are multiple formats to export, it will only open the document once. The exported file has it's Date Modified attribute (or mtime) set to the modified date (time) of the document (see File Time section for additional info).
For sketches, it will create a folder hiearchy like <export directory>/<project name>/<component names ...>/<sketch name>.dxf.
Since document names might have invalid filename characters, we attempt to replace them with spaces. In order to avoid a false collision, if any chars are replaced, the document name will have 8 hexchars of sha256 hash of the original utf-8 encoded document name. Eg model 1/2 \ * ? <morechars> || would be saved as model 1 2 morechars _29a6fecc_v1.f3d
In some ways this is an export and in others, it is more of a sync, since it won't re-export files that already exist and it skips opening documents it doesn't need to (with the caveat being we always have to open every document when exporting sketches).
It will create a log file at <export_directory>/<timestamp>.txt that should have some more info if things go wrong.
File Time
Starting in version 20240813.1, newly exported files have their Date Modified (or mtime) attribute set to the document's modified time. If you didn't want this you could replace the set_mtime function with a noop (ie just pass) or open an issue if you think this should be more configurable. However, by default it will not update the mtime for files that already exist which have their mtime corresponding to when the file was exported, not when the document was modified. If you wanted to do a one-time synchronize for these times, look at the top of source for the variable update_existing_file_times. I'm leaving it off by default to avoid pointlessly setting it on every run. And you would need to run the one-time synchronize with all the file formats and projects and versions etc selected that correspond to all the files you want updated.
Folders' mtime are not handled.
Save Mesh Bodies
When this option is selected, mesh bodies are saved as STL files in the same folder as where the sketches are saved.
The STL file is scaled to mm per unit. Fusion's internal unit is cm. STL has no unit metadata and the de-facto convention (FreeCAD, PrusaSlicer, etc.) is mm, so the STL is scaled by 10.
The normals in the STL file are computed from the vertices of the mesh body.
Limitations + Known Issues
- Not sure what other file types are out there (simulation data maybe? etc) but it only handles
.f3ddocuments - Only visible bodies are included in exports to all file formats except
f3d. Use the "Unhide All Bodies" option to unhide them before exporting, or to save an additional export with them unhidden - Image renders might cause an error. See #4
- Cloud solves might cause an error. See #3
Saved Settings
To easily run the same settings repeatedly, you can copy-paste the Template folder in UserScripts so that you have UserScripts/YourScriptName/YourScriptName.{py,manifest}. Then, open up a log file of a run that you want to replicate and copy paste the JSON blob at the beginning into YourScriptName.py. Then add this into Fusion as a script and run normally.
Note that we store project and folder id's, so renaming a project/folder will not break your backup script. But if you happen to replace the folder with a new one of the same name, it won't work.
You might run into an issue with the VERSION_SEPARATOR (whether it is export file_v42.stl or file v42.stl) if you are using saved settings.
TODO (Maybe)
- Saving electronics documents? these are
fbrdfiles - Per-component export of
stl(or other format); currently only the root component is exported with everything in it
Credit
- Pulled the addition of
3mffrom tavdog - Problematic
"in project names reported by TheShanMan - Installation doc improvement reported by sqlBender
- Version ordering bug reported and diagnosed by loglow
- Non-design file support added by raphael-bmec-co
- f2d support and using active folder by robertkuyper
- bug fix by hiroloquy
- Figured out f3d thumbnails with Happy1Snappy
Dev
Discussion about some changes are in issue 23 on folder output structure. I implemented most of those ideas in the dev branch some time ago -- including a way to write tests -- but never felt like it was a great change so it is abandoned.
探索相关项目
加载中…