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.
Callers should not parse .lbr XML for names, and show_3d_package should not render a Placeholder as success
The caller should not have to parse .lbr XML, or know to bind 3D before showing it
I got the library card working by writing three things into my client. Every one of them looks like bridge work, and if I need them then so does the wiki's Quick Actions client, and so does every other caller. Filing before that spreads.
1. Name resolution: I am parsing your XML
fusion_show_symbol {name: "CL21B104KBCNFNC"} fails with:
No symbol named 'CL21B104KBCNFNC' in that library, so the EDIT was NOT issued.
Correct refusal, and I like that it does not guess. But the reason is that the .lbr declares CL21B104KBCNFN - no trailing C. So my client now does this:
read_file(lbrPath) -> body.match(/<symbol\s+name="([^"]+)"/) // and <package>, <deviceset>
A caller reading the bridge's own file format to work out what to ask the bridge for is a smell. You have the library open; you know the names. Options, cheapest first:
- Accept the deviceset/file stem and resolve internally. The deviceset IS
CL21B104KBCNFNand the file isCL21B104KBCNFNC.lbr; one is derivable from the other by looking, which is what I am doing from outside. - Or put the names in the error:
availableSymbols: ["CL21B104KBCNFN"]. Then a caller retries correctly without knowing the file format. This is the same fix kicad made for footprints (closestMatches), and it turned an opaque failure into a self-correcting one.
A fusion_list_library {libraryPath} returning {symbols[], packages[], devicesets[], package3d[]} would also solve it and is useful on its own.
2. fusion_show_3d_package renders a Placeholder instead of failing
This is the one that cost a false pass. Before any bind, the library has no package3d, and the verb returns success while Fusion displays its grey Placeholder slab:
Component Properties -> Packages: Footprint: 0402B102J500... Package: "Placeholder" Mapped: yes
My card captured that, counted three artifacts, and reported the library proven. A human looking at the screenshot sees a featureless grey block where their capacitor should be. The verb is technically truthful (it showed the 3D package that exists) and practically misleading.
Ask: if there is no package3d bound, fusion_show_3d_package should either bind it (the data is right there - the caller passed stepPath) or fail with errorCode: "no_3d_bound" and _hint: "call fusion_bind_library_3d first". Anything but a success over a placeholder.
For the record fusion_bind_library_3d works, and it is impressive - verified in the file, not just the response:
before: package3d=0 urn=0
after : package3d=3 urn=2
package3d name="0402B102J500CT"
wip_urn="urn:adsk.wipprod:fs.file:vf.Vxb6sB-uTRasc0Z07dM2Hw?version=1"
locally_modified="yes" type="model"
That is the hard part of this whole feature and it does it in one call. Which is why it is worth having show_3d_package refuse to fake it when it has not been done.
3. Sequencing knowledge lives in my client
My card now knows: resolve names, then bind 3D, then open the library, then wait for idle between each show. That ordering is Fusion domain knowledge, and it is currently only in my head and my JavaScript. The wiki client will get this wrong in exactly the ways I did.
A single fusion_prepare_library {libraryPath, stepPath} that resolves, binds and reports {symbols, packages, bound, wip_urn} would let any caller do the right thing in one call. fusion_capture_library_views already shows you think in these terms - it captures the three views an EE trusts in one call, which is the same instinct.
Why this matters beyond my demo
The consumer here is a browser on the Adom wiki: someone clicks "open in Fusion" on a part page. That client cannot read local .lbr files, should not encode Fusion's editor sequencing, and will absolutely ship a Placeholder screenshot as proof if the verb says success. Whatever this bridge does not own, every caller reimplements - and gets wrong.
Related: #40 (busy reported as not-responding) is the fourth instance of the same theme - the caller compensating for something only the bridge can see.
6 Replies
Log in to reply.