Fusion - the Fusion 360 Bridge
Public Made by Adomby adom
Drive Autodesk Fusion 360 from the cloud via Adom Bridge: component libraries, IPC package generation, board layout, exports (STEP/Gerbers/BOM/CPL), fast APS cloud search, and parametric modeling.
Save an electronics design in place (no Save As fork), save the 3D PCB beside it, re-import as a new version
From adom-aiflow 0.2.3 (issue adom/adom-aiflow#74, items 6 and 7, reported by Muzzer on fusion-bridge 1.11.39; source read at 1.11.43).
What happens today
fusion_save_to_cloud {name, projectName, folderPath} is app.activeDocument.saveAs(name, folder, ...)
(addin/AdomBridge/commands/cloud_documents.py, handle_save_to_cloud). It is the only save verb.
- The first save of a new electronics design saves the whole design: .fprj, .fsch and .fbrd, linked.
- Every later save made while the 2D board is the active document writes the board as a NEW standalone .fbrd of the same name. The design (.fprj) keeps linking the original, unrouted board. In Muzzer's run the routing, pours and silkscreen all ended up in the unlinked .fbrd; opening the design showed a board with 0 tracks. He had to export both halves, re-import them as a new design and delete six stale files.
- The design's 3D PCB document (
<Design>.f3d) was saved into the active project's root, not the design's folder. - Each re-import of a design (
fusion_new_electronics_from_eagle, used by aiflow's 3D restore and by any re-run) leaves another set of files with the same name. Muzzer's run folder ended with one .fprj, one .fsch and four .fbrd all called "Buck12V5V", which the data panel cannot tell apart.
What adom-aiflow does now (0.2.3)
- It saves only a new design's first save, and refuses when the active document (or any open document
of that name) already has a
dataFile, or when the target folder already holds a file of that name. - It reads the folder back after the save and warns when a file kind appears twice under the name.
- It has no in-place save, so a checkpoint save of a design already in the cloud is left to the human.
Asked of the bridge
fusion_save_document {expectDocument?, comment}: save the open electronics DESIGN in place (Document.save(comment)), never Save As. Resolve the design document itself (the one whose product is the electronics design, not the board or schematic view that is in front), activate it if needed, save, then verify and return:fileId,versionNumberbefore and after (the version must go up by one),- the board the design links (its .fbrd lineage) and that it is the board that was just edited (for
example the board document's
dataFile.idmatches the design's linked board), success:false, errorCode:"not_saved_yet"when the design has nodataFile(usefusion_save_to_cloudfor a first save).
fusion_save_to_cloudrefuses a Save As of an already-saved electronics document unless the caller passesasCopy:true, with anerrorCode(for examplealready_saved_use_save_document) and a hint namingfusion_save_document. This is the data-loss guard: a Save As by name on a saved design with the board in front should never happen silently.- Save the design's 3D PCB document beside the design (same project and folder), not in the active project's root.
- Re-import into an existing design as a new version: for example
fusion_new_electronics_from_eagle {schPath, brdPath, intoDesign: <fileId or name+projectName+folderPath>}that opens the existing design, replaces its schematic and board from the files, and saves a new version of the same lineage (no new .fprj/.fsch/.fbrd). Until then, any import that is closed without saving should leave no files behind; please confirm thatfusion_close_document {save:false}on a never-saved imported design (nodataFile) writes nothing to the hub.
Acceptance
On a design saved once into <project>/<folder>: route a net with the 2D board in front, call the new save,
then close everything and open the .fprj from the data panel. The board shows the routed net, the folder
holds exactly one .fprj, one .fsch and one .fbrd of that name (plus the .f3d beside them), and the .fbrd's
version went up by one. A fusion_save_to_cloud on that same open design is refused.