by adom
Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.
altium_build_schematic wires pins of every display mode, shorting nets
altium_build_schematic draws stubs and net labels at the pins of every display mode, shorting nets
Component: altium-bridge 0.2.120, altium_build_schematic (agent CmdBuildSchematic in AdomAgent.pas.tmpl). Secondary items for adom-aiflow (tools/altium-project.py, cmd_schematic) at the end.
What was run
adom-aiflow altium schematic --netlist design/netlist.json --name <Design> on a 144-part design (118 parts with symbols, 81 nets, 11 blocks). The project library was built by adom-aiflow altium library, whose symbols carry several display modes (one symbol had 10 modes, 120 pins = 12 pins x 10).
Symptom
ERROR: ... the compiled sheet's netlist differs from nets on 61 net(s). The compiled netlist had 32 nets, one with 315 pins holding both pins of many decoupling capacitors (GND, +5V, +3V3 and others merged). The render looked tidy; the shorts are not visible because the extra labels sit exactly on the visible stub ends.
Cause
altium_sch_items on the sheet: 918 net labels and 716 wires for 348 netted pins. Exactly 348 labels sit on the shown pins' stub ends with the right net; the other 570 come from the pin loop in CmdBuildSchematic:
PIt := Inst.SchIterator_Create;
PIt.AddFilter_ObjectSet(MkSet(ePin));
This iterates the pins of every display mode (and every part) of the placed component, not only the shown mode. Each hidden-mode pin gets a wire and a net label at its own location. When the modes place pins differently (for example, pin 1 in mode 3 sits where pin 4 is in mode 0), a label of one net lands on another net's stub, and the compiler joins the nets. The measuring loop already filters with IsDrawn (mode 0), so the layout is right; only the wiring loop is wrong. Rebuilding gives the same 918/716 counts, so these objects are not left over from an earlier run.
Fix (applied locally, verified)
In the pin loop, skip pins that are not shown:
PinShown := (Pin.OwnerPartDisplayMode = Inst.DisplayMode) And
((Pin.OwnerPartId = 0) Or (Pin.OwnerPartId = Inst.CurrentPartID));
When PinShown is false, draw no wire or label and do not list the pin in pinsWithoutNet. After altium_agent_stop, the next verb re-rendered the agent. The same design then compiled to the netlist pin for pin.
Nice to have: altium_sch_items lists the same item once for each object stacked at a spot. A de-duplicated count, or a warning about stacked objects, would have made this obvious.
adom-aiflow items found on the way
- When the netlist names a pin the symbol lacks (for example a datasheet's shared-pad alias "A1/B12", or "TAB"), the mismatch only shows as an extra single-pin
Net<Ref>_<pin>and a missing pin.altium schematiccould check, before drawing, that every netlist pin exists on its symbol, and name the pin. - Altium reports "Net X has only one pin" for nets whose other pins are board-only parts (MPN-less test points) kept off the sheet. That is expected, but the proof records it as an ERC failure (
erc.pass: false). Proposed: put those messages inerc.expectedBoardOnly. The diff is attached; it was not applied, because the tools are compiled into the binary. - Proposed safeguard (same diff): close the design's sheet, board and project before
altium_build_schematic, so a copy a previous run left open is never drawn on.