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.
Anchored dimensions on library footprints (verb), silkscreen clearance check, and stray mechanical layers
altium-bridge 0.2.118 · Altium Designer Develop 26.x · Windows 11 (Hydrogen local workspace)
Request
A verb that puts anchored linear dimensions on a library footprint: true Altium dimensions whose two ends lock to the footprint's pads or assembly-outline corners, so they follow those primitives when they move. Plus a few related footprint-quality checks.
Why
- The layer map already has a
dimensionskey, but no footprint verb draws anything there. - DelphiScript can't set a dimension's references.
IPCB_Dimensionreference setters don't stick, and dimensions made by script come out unanchored. So there's no way to do this throughaltium_evaleither. - Organisations that document footprints (pitch, row spacing, body envelope, hole positions) on a dimensions layer currently have to place every dimension by hand.
A method that works (proven on a real part, 2026-12-02)
Write an ASCII PcbDoc containing:
- the footprint's pads;
- its assembly (body) outline as four single tracks, one per edge;
RECORD=Embeddedlinear dimensions whoseREFERENCE0*/REFERENCE1*fields point at those records:PRIMindex,OBJECTID/OBJECTSTRING(Pad or Track),POINTX/Y, andANCHOR(1 = pad centre; for a track, 1 = X1/Y1 end and 2 = X2/Y2 end).
Open it in Altium. The references validate.
Move the same object instances into the library footprint:
B.RemovePCBObjecton the work board;Lib.Board.AddPCBObjectplusPCBM_BoardRegisterationin the library.
Don't change their layers, and don't recreate them.
Save, close and reopen the PcbLib, then require
References_Validate = Truefor every dimension.
Observations:
- Pad references are saved bound to the pad.
- A reference on a corner shared by two outline tracks is saved as position-only (
NoObject), and Altium re-binds it on load. Altium's own hand-placed corner references save the same way. - The library's board origin is offset from the ASCII work board's origin (50000 mil in our template). The transfer has to check that offset.
Proposed verbs
altium_add_dimensions {libraryPath, footprint, dimensions: [{a, b, dir: "H"|"V", at, expect?}], format?}a/bare a pad name, or an outline corner such asFRONT@1orLEFT@2.atis the position of the dimension line.- Format comes from the call or a library default: text font and height, line width, arrow size, extension offset, units rule (e.g. mil when a length is a whole multiple of 5 mil, otherwise mm to 2 decimals).
- The dimensions land on the layer-map
dimensionslayer. - The reply lists each dimension's text and its validity after a reopen. With
expect(a value in mm, e.g. read from the datasheet), it also reports each one MATCH or MISMATCH against a tolerance.
- A body-outline option on
altium_footprint_from_land_pattern: draw the assembly outline as one track per edge, so it can be dimensioned to its corners. altium_check_silkscreen {libraryPath, footprint, minMm, maskExpansionMm?}- Measures, on the saved footprint, edge-to-edge clearance between every Top/Bottom Overlay line, arc and text and each pad's exposed copper (the pad grown by the mask expansion).
- Reports the closest pair and PASS/FAIL.
- Today the bridge only trims silkscreen within 0.2 mm while drawing, and nothing re-checks the saved result.
Smaller related issues found on the way
- The footprint verbs create Mechanical 1 and Mechanical 9 "Adom.SolderBalls" in the library even when nothing is drawn on them. This happened even with an organisation layer map in place; we now map
commentandballsto template layers as a workaround. Please only create a layer when a primitive is actually placed on it. altium_edit_footprintgraphics: shapes take{type: "line", start: [x, y], end: [x, y]}/{type: "circle", center, radius}, and the width only works at layer level (widthMm). Per-shape widths are ignored, so a filled dot needs two concentric circles.F.Fabresolves to legacy Mechanical 13, so typed layers have to be addressed asL<id>. None of this is in the skill.