---
name: fusion-electronics
description: How to drive Fusion 360 Electronics (the EAGLE-based schematic + PCB editor) through the Adom Fusion bridge - the file hierarchy (open the PROJECT, never the schematic/.brd/3D), switching between schematic / 2D board / 3D PCB views, and moving the editor for demos and screen recordings (zoom, pan, frame a region, orbit the 3D board, select parts, surface the properties panel). Read before opening or recording any PCB. Trigger words - fusion electronics, fusion pcb, open the board, open the schematic, fusion_show_2d_board, fusion_show_3d_board, eagle editor, zoom the board, pan the board, orbit the 3d pcb, select a part, properties panel, record the schematic, record the board, board out of date, empty 2d board, EcadDesignProductType, parent child electronics design.
---

# Fusion Electronics - drive the schematic, board, and 3D PCB

## 1. ALWAYS open the PROJECT, never a child file

A Fusion electronics design is NOT one file. It is a parent/child chain of separate files, each a
distinct `productType`:

```
PROJECT        EcadDesignProductType    <- OPEN THIS ONE
  |- schematic   SchematicProductType
  |- board/.brd  BoardProductType
  |- 3D PCB      DesignProductType        (generated FROM the .brd - the LEAF; opening it gives NO editable board)
```

- Open the PROJECT with `fusion_open_cloud_file` / `fusion_open_by_urn`. Then the schematic and board
  are children you switch between - they are VIEWS of the one design, not separate things to open.
- **Opening a schematic / .brd / 3D directly** gives an isolated or empty view, and you cannot derive
  the board from the 3D (it is the leaf). The open verbs **reprimand you in the response `_hint`** when
  the opened file is not `EcadDesignProductType` - read it and reopen the project.
- Same-named copies in OTHER projects (e.g. a drone assembly that imported the board) are usually
  3D-model derivatives (`DesignProductType`), not the project. Do not open those.
- An EMPTY 2D board (`fusion_board_info` returns 0 elements) almost always means you opened the wrong
  file. Reopen the parent PROJECT and switch to its board.

## 2. Switch between the views

The design is open; switch the LIVE editor between its three views with the symmetric trio:
- `fusion_show_schematic` - the schematic (circuit diagram). Uses Fusion's `SwitchSchDocCmd`.
- `fusion_show_2d_board` - the 2D PCB Editor (board layout / copper). `SwitchPcbDocCmd`.
- `fusion_show_3d_board` - the populated 3D PCB. `Switch3dPcbDocCmd`.

All three move the VISIBLE editor (not just the API's active doc), so they're what you use to set up a
recording of a given view. Schematic queries also run via the `Electron.sch_*` text commands. These are
VIEWS of the open project - if a view is empty, you opened a child/derivative (see section 1).

## 3. Move the editor for demos / screen recordings

Give a recording "life" with these FIRST-CLASS verbs. Each runs its WHOLE motion inside the add-in -
one call = one smooth move, a repaint per frame (the 2D analogue of `vp.refresh()`):

### Zoom (schematic / 2D board)
`fusion_electron_zoom {factor, steps?, frameDelayMs?}` - `factor>1` zooms in, `<1` out; or `{fit:true}`.
  e.g. `adom-desktop fusion_electron_zoom '{"factor":3,"steps":20}'` (smooth zoom in over 20 frames).

### Pan + frame a region (or a part)
`fusion_electron_pan {x1,y1,x2,y2, steps?, frameDelayMs?}` - glide+zoom to a board-coordinate box (mm).
Animates from where the view last was. Get part coordinates from `fusion_board_info` or the CPL export
(`fusion_export_cpl` gives every part's Mid X / Mid Y) - frame a small box around a part to "go to" it.
  e.g. `adom-desktop fusion_electron_pan '{"x1":10,"y1":15,"x2":22,"y2":38,"steps":16}'`.

### Select a part + surface its properties
`fusion_electron_select {name}` (reference designator) or `{x,y}` (board mm) - selects the part the way
clicking it reveals the properties panel, and returns its device info. (Select highlights; pair with
`fusion_electron_pan` to also center on it - the "select chip -> zoom to it" tour.)
  e.g. `adom-desktop fusion_electron_select '{"name":"U1"}'`.

### Orbit / zoom the 3D PCB (Fusion camera)
`fusion_show_3d_board`, then `fusion_run_modeling_script` with a camera loop: `app.activeViewport.camera`,
step the eye around the target in azimuth (vary radius to zoom), `cam.isSmoothTransition=False`,
`vp.camera=cam`, **`vp.refresh()`** + `adsk.doEvents()` + a short `time.sleep()` each frame. The
`vp.refresh()` is what makes the in-between frames render.

### Lower-level building blocks (what the verbs above wrap)
`fusion_electron_run` runs raw EAGLE: `WINDOW FIT`, `WINDOW <factor>`, `WINDOW (x1 y1)(x2 y2)`, `DISPLAY`,
`RATSNEST`, `GRID`. `fusion_execute_text_command` runs `Electron.*`: `SelectbyName`, `LeftButtonDown` /
`Select` x y (+ `ContinueSelect` / `EndSelect` for a marquee), `ImmediateRepaint /full`,
`sch_get_deviceinfo`. Reach for these only when a first-class verb doesn't cover what you need.

### Capture without disrupting the user
Record with WGC (`desktop_record_window_start`) - background, no focus steal, and it grabs the LIVE EAGLE
GL canvas. PrintWindow (`desktop_screenshot_window`) shows the chrome but does NOT reflect the GL view
changing, so verify motion by the verb's `ok` + a WGC frame, not a PrintWindow pixel-diff. A black canvas
means an empty/wrong file - see section 1.

## Gotcha: file paths WITH SPACES (fixed in v1.6.90 - issue #196)

`executeTextCommand` is a **space-delimited** command string, so `Document.newDesignFromLocal`
used to receive an unquoted path and split it at the first space:

```
C:/Users/drew/Downloads/e2e-pmcoil/PM COIL Molecule.brd
                                   ^ Fusion only ever saw ".../PM"
```

The open then **silently no-op'd** - no dialog, no document, just the generic "Fusion 360 may not
support this file" hint - which sent the reporting agent hunting for a file-format problem when it
was pure path handling. (Caught by Drew's agent: the identical file opened instantly once copied to
a space-free name.)

Fixed in `_open_local_document()` (`commands/open_electronics_file.py`), now used by
`fusion_open_board`, `fusion_open_schematic`, `fusion_import_electronics` and `fusion_open_lbr`:

1. **Quote the path**, then
2. if that fails and the path has spaces, retry with the Windows **8.3 short path**
   (`GetShortPathNameW`) - same file, no spaces, nothing copied.

**If you are writing a new verb that hands a path to `executeTextCommand`, use that helper.** Never
interpolate a bare path into a text command; assume every user path has spaces in it, because
Downloads and OneDrive folders routinely do.
