skill
fusion-export-molecule
Public Made by Adomby adom
Ship a Fusion 360 Electronics design to the Adom wiki as a molecule: bridge-driven export (BRD/SCH/F3D/STEP/USDZ, Gerbers and drill), <slug>-fab.zip and export.json, a sources-only publish through molecule-publish (the wiki's model registry builds the GLB, footprint and symbol), and adom-wiki model import into Hydrogen.
Comparing master ← fix/current-bridge-verbs
Changes on fix/current-bridge-verbs that are not yet on master (three-dot, from the merge base).
1 file changed, 47 insertions(+), 33 deletions(-)
SKILL.md+47−33@@ -7,7 +7,7 @@ description: Export a Fusion 360 Electronics design as an Adom molecule — orch Export a Fusion 360 Electronics design as an Adom molecule — the STEP + board + silkscreen bundle the wiki/OCCT pipeline and the Hydrogen viewer consume — by orchestrating AdomBridge CLI primitives from the container. -**Prerequisite:** `adom-desktop` must be connected (`adom-desktop ping`) and Fusion must be running with the design open.+**Prerequisite:** Adom Bridge must be connected (`adom-bridge ping`) and Fusion must be running with the design open. ## EasyEDA logo: remove it during creation (always) @@ -20,7 +20,7 @@ Export a Fusion 360 Electronics design as an Adom molecule — the STEP + board ## Architecture -The export is **orchestrated from the container** using existing `adom-desktop fusion_*` primitives. No custom add-in commands or HelperJoe buttons are needed — each step calls a standard AdomBridge verb.+The export is **orchestrated from the container** using existing `adom-bridge fusion_*` primitives. No custom add-in commands or HelperJoe buttons are needed — each step calls a standard AdomBridge verb. ``` Container (skill orchestration)@@ -31,8 +31,8 @@ Container (skill orchestration) ├── fusion_export_f3d → Fusion archive ├── fusion_export_step → STEP 3D model ├── fusion_export_usdz → AR/Hydrogen 3D model- ├── fusion_take_silkscreen_screenshot → top silkscreen PNG- ├── fusion_take_silkscreen_screenshot → bottom silkscreen PNG+ ├── fusion_export_optimized_glb → silk PNGs (top + bottom), OCCT molecule GLB,+ │ .brd, footprint/symbol JSON, publish gates └── pull_file → copy all files to container ``` @@ -48,13 +48,13 @@ screen-coord clicks are unreliable on multi-monitor/HiDPI). Targeting the `.fbrd entirely and lands straight in PCB Editor (live-confirmed): ```bash-adom-desktop fusion_open_cloud_file '{"projectName":"Main","folderPath":"Molecules/COSMIIC","fileName":"PG4 FRAME MOL","fileExtension":"fbrd","recovery":"discard"}'+adom-bridge fusion_open_cloud_file '{"projectName":"Main","folderPath":"Molecules/COSMIIC","fileName":"PG4 FRAME MOL","fileExtension":"fbrd","recovery":"discard"}' # → doc opens in PCB Editor, NO picker. (Omitting fileExtension may hit the multi-design picker.) ``` Then verify: ```bash-adom-desktop fusion_get_app_state '{}'+adom-bridge fusion_get_app_state '{}' ``` Ensure: Fusion running, `activeWorkspace` is `PCB Editor`, `isElectronics: true`. @@ -64,72 +64,86 @@ CDP into the CEF dialog. `fusion_window_info` / the bridge's `blockingDialogs` w If already open but not in PCB Editor: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+adom-bridge fusion_electron_run '{"command":"EDIT .brd"}' ``` ### Step 1: Export BRD ```bash-adom-desktop fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.brd","format":"brd"}'+adom-bridge fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.brd","format":"brd"}' ``` ### Step 2: Export SCH Switch to schematic, then export: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .s1"}'+adom-bridge fusion_electron_run '{"command":"EDIT .s1"}' sleep 2-adom-desktop fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.sch","format":"sch"}'+adom-bridge fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.sch","format":"sch"}' ``` Switch back to board after: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+adom-bridge fusion_electron_run '{"command":"EDIT .brd"}' ``` ### Step 3: Switch to 3D view ```bash-adom-desktop fusion_show_3d_board '{}'+adom-bridge fusion_show_3d_board '{}' ``` Wait for workspace to switch (5-10s). Verify: ```bash-adom-desktop fusion_get_app_state '{}'+adom-bridge fusion_get_app_state '{}' # Expected: activeWorkspace: "Design" or "3D PCB" ``` ### Step 4: Export F3D ```bash-adom-desktop fusion_export_f3d '{"outputPath":"C:/tmp/export/<name>.f3d"}'+adom-bridge fusion_export_f3d '{"outputPath":"C:/tmp/export/<name>.f3d"}' ``` ### Step 5: Export STEP ```bash-adom-desktop fusion_export_step '{"outputPath":"C:/tmp/export/<name>.step"}'+adom-bridge fusion_export_step '{"outputPath":"C:/tmp/export/<name>.step"}' ``` ### Step 6: Export USDZ ```bash-adom-desktop fusion_export_usdz '{"outputPath":"C:/tmp/export/<name>.usdz"}'+adom-bridge fusion_export_usdz '{"outputPath":"C:/tmp/export/<name>.usdz"}' ``` -### Step 7: Capture silkscreen PNGs+### Step 7: Silkscreen PNGs (and the OCCT molecule GLB)++There is no standalone silkscreen verb: `fusion_take_silkscreen_screenshot` is internal to the+bridge and answers Unknown command. The silk capture runs inside `fusion_export_optimized_glb`,+which writes `<name>_silk_top.png` and `<name>_silk_bottom.png` beside its output, then sends+them with the STEP (and, from the fusion-bridge release after 1.11.39, the `.brd`) to the OCCT+molecule converter: ```bash-adom-desktop fusion_take_silkscreen_screenshot '{"outputPath":"C:/tmp/export/<name>_silkscreen_top.png","layer":"top"}'-adom-desktop fusion_take_silkscreen_screenshot '{"outputPath":"C:/tmp/export/<name>_silkscreen_bottom.png","layer":"bottom"}'+adom-bridge fusion_export_optimized_glb '{"outputPath":"C:/tmp/export/<name>.glb","async":true}'+# poll until done:+adom-bridge fusion_fetch_optimized_glb '{"exportId":"<exportId from the reply>"}' ``` -These produce 2048x2048 transparent-background PNGs. Requires the 3D Design view (done in Step 3). Each capture takes ~3s (includes 1s render sleep).+Besides the silk PNGs, this leaves `<name>.glb` (OCCT molecule mode) and its STEP in the folder.+On a bridge with board support (adom/fusion-bridge PR #17) it also writes `<name>.brd`,+`<name>_footprint.json`, `<name>_symbol.json`, `<name>-fab.zip` (Gerber + drill from the+bridge's own CAM job, on every export) and `export.json` (Fusion version, every source file+with its sha256 and role, the stackup), and the reply carries `gates` (footprintApplied,+footprintPins, pinSize, warnings). Push the fab zip and export.json with the other sources:+board-look builds the board from them. If those gates pass, `molecule-publish` can reuse the GLB and JSON instead of+converting again. ### Step 8: Pull files to container ```bash-adom-desktop pull_file '{"filePaths":["C:/tmp/export/<name>.brd","C:/tmp/export/<name>.sch","C:/tmp/export/<name>.f3d","C:/tmp/export/<name>.step","C:/tmp/export/<name>.usdz","C:/tmp/export/<name>_silkscreen_top.png","C:/tmp/export/<name>_silkscreen_bottom.png"],"saveTo":"/tmp/export"}'+adom-bridge pull_file '{"filePaths":["C:/tmp/export/<name>.brd","C:/tmp/export/<name>.sch","C:/tmp/export/<name>.f3d","C:/tmp/export/<name>.step","C:/tmp/export/<name>.usdz","C:/tmp/export/<name>_silk_top.png","C:/tmp/export/<name>_silk_bottom.png"],"saveTo":"/tmp/export"}' ``` ### Output files@@ -141,8 +155,8 @@ adom-desktop pull_file '{"filePaths":["C:/tmp/export/<name>.brd","C:/tmp/export/ | `<name>.f3d` | Fusion archive | Full parametric 3D model | | `<name>.step` | STEP | CAD interchange 3D model | | `<name>.usdz` | USDZ | AR/Hydrogen 3D viewer |-| `<name>_silkscreen_top.png` | PNG | Top silkscreen render (transparent bg) |-| `<name>_silkscreen_bottom.png` | PNG | Bottom silkscreen render (transparent bg) |+| `<name>_silk_top.png` | PNG | Top silkscreen render (transparent bg) |+| `<name>_silk_bottom.png` | PNG | Bottom silkscreen render (transparent bg) | ## Kitchen Sink Export @@ -152,28 +166,28 @@ For manufacturing files in addition to the Hydrogen export, add these steps afte Switch back to 2D board first: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+adom-bridge fusion_electron_run '{"command":"EDIT .brd"}' sleep 3-adom-desktop fusion_export_gerbers '{"outputPath":"C:/tmp/export/gerbers.zip"}'+adom-bridge fusion_export_gerbers '{"outputPath":"C:/tmp/export/gerbers.zip"}' ``` ### BOM ```bash-adom-desktop fusion_export_bom '{"outputPath":"C:/tmp/export/bom.csv"}'+adom-bridge fusion_export_bom '{"outputPath":"C:/tmp/export/bom.csv"}' ``` ### CPL ```bash-adom-desktop fusion_export_cpl '{"outputPath":"C:/tmp/export/cpl.csv"}'+adom-bridge fusion_export_cpl '{"outputPath":"C:/tmp/export/cpl.csv"}' ``` ## Saving Designs The cloud save command: ```bash-adom-desktop fusion_execute_text_command '{"command":"Commands.Start PLM360SaveCommand"}'+adom-bridge fusion_execute_text_command '{"command":"Commands.Start PLM360SaveCommand"}' ``` This opens a Save dialog. Find and confirm it:@@ -181,15 +195,15 @@ This opens a Save dialog. Find and confirm it: # Wait for dialog sleep 5 # Press Enter to confirm (finds Save dialog automatically)-adom-desktop fusion_send_key '{"key":"enter"}'+adom-bridge fusion_send_key '{"key":"enter"}' ``` ## Caching Bug Workaround After saving, exports may produce stale files. Workaround:-1. Close all project tabs: `adom-desktop fusion_close_document '{"save":false}'` (repeat)-2. Reopen the **board** (`.fbrd`, NOT `.fprj` — the project file triggers the multi-design picker): `adom-desktop fusion_open_cloud_file '{"projectName":"Main","fileName":"<name>","fileExtension":"fbrd","folderPath":"<path>"}'`-3. Switch to board view if needed: `adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'`+1. Close all project tabs: `adom-bridge fusion_close_document '{"save":false}'` (repeat)+2. Reopen the **board** (`.fbrd`, NOT `.fprj` — the project file triggers the multi-design picker): `adom-bridge fusion_open_cloud_file '{"projectName":"Main","fileName":"<name>","fileExtension":"fbrd","folderPath":"<path>"}'`+3. Switch to board view if needed: `adom-bridge fusion_electron_run '{"command":"EDIT .brd"}'` 4. Run the export steps above ## After Export — Hand off to molecule-publish@@ -243,7 +257,7 @@ After the export completes, tell the user: ## Important Notes -- **Focus stealing:** Steps 3 and 7 switch Fusion workspaces, which steals desktop focus. Warn the user.+- **Background:** the view switches in Steps 3 and 7 go through the add-in API and do not raise Fusion or take focus (see the fusion-driving skill). - **3D view required for Steps 4-7.** If `fusion_show_3d_board` fails, the user may need to run "Push to 3D PCB" manually from the Design tab. - **Silkscreen capture** requires the 3D Design view, not PCB Editor. Always do Steps 4-7 after Step 3. - **pull_file from Google Drive paths** may produce empty files. Use shell_execute + base64 as a workaround if the output folder is on Google Drive.