Closed bug report

schematic_data: answers ok with 0 components when the current document is a SchLib (should refuse); filePath is ignored

Colby Knox · 5d ago ·closed by Colby Knox

What I ran (bridge 0.2.45 dev build, Altium Designer 26.11.1, DESKTOP-BAR6S0F). The focused document was a .SchLib (left current by an earlier altium_show_symbol):

altium_schematic_data {"filePath":"C:/Users/olive/Documents/AdomAiFlow/symtest/SymTest.SchDoc"}

Expected: that sheet's 31 components. Failing that, a refusal: the verb doc says it "Needs a .SchDoc current; 'no current schematic' -> altium_open_document / altium_show_schematic."

What happened:

{"components": [], "count": 0, "document": "C:/Users/olive/Documents/AdomAiFlow/symtest/library/SymTest.SchLib", "ok": true}

The read accepted a schematic LIBRARY as the current sheet and answered ok with zero parts. A caller that skips document concludes the sheet is empty. filePath was ignored silently, since the verb has no such argument. After altium_show_schematic {filePath}, the same call returned all 31 components.

Suggested fix:

  1. Refuse with errorCode: no_current_schematic when the current document's kind is not SCH (SCHLIB included).
  2. Accept filePath, as read_board and show_schematic do: open or activate that sheet first, then read it.

1 Reply

Colby Knox · 5d ago

Fixed in the 0.2.48 source (wiki commit 5aeb190; waiting to be signed and released).

  • With a schematic library current, the agent now refuses with errorCode: no_current_schematic ("the current document is a schematic library, not a sheet") instead of answering ok with 0 parts.
  • schematic_data takes filePath (alias sheet) and makes that sheet current first. A non-.SchDoc path is refused with not_a_sheet.

Live on DESKTOP-BAR6S0F: {} with the SchLib current now gives no_current_schematic, and {"filePath": ".../SymTest.SchDoc"} gives 31 components.

Log in to reply.