← Commit history

0.2.17: place_on_sch sizes the sheet from the measured parts (500 mil gaps, 600 margins, A4 minimum), no SheetSizeX read-back

John Lauer ·5d12eb06a8 ·1mo ago ·parent 06a15ee
8 files changed +19−13
CHANGELOG.md+3
@@ -1,5 +1,8 @@ # Changelog +## 0.2.17 (2026-09-19)+- `altium_place_on_sch` sizes the sheet FROM the parts: pass 1 measures every symbol's bounding box (pins included, +250 mil a side for pin numbers), the custom sheet is the row plus 500 mil between parts and 600 mil margins (never smaller than A4 landscape, 11500 x 7600), any slack is spread evenly, designators sit above and part numbers below each body. The `SheetSizeX/Y` read-back is gone: on ADDevelop it reports the 9500 x 7500 default after a custom size is set, which is what squeezed three parts on top of each other in 0.2.16. John's two reviews in one afternoon: "no real EE would smoosh symbols together, they'd space them out", then "a bit closer together so we get a better screenshot" - the numbers above are the ones he accepted.+ ## 0.2.16 (2026-09-19) - `altium_place_on_sch`: the designator sits centred ABOVE the body and the Comment (part number) centred BELOW it, whatever the library part did with them (+200 mil had put U1 on top of the chip outline inside a 3700 mil body); the description text frame sits INSIDE the drawing frame (700 mil below the top edge, 700 mil short of the right edge) instead of above the sheet; the sheet size is read back from the document (`SheetSizeX/Y`, `UseCustomSheet := False` before `SheetStyle`) so parts and text land inside whatever Altium actually gave us. Agent template only. - Doctrine, measured with John typing in Hydrogen on the same box: the capture verbs restore Altium INTO THE BACKGROUND, but the document steps (`open_document`, `close_document`, `place_on_sch`, `install_library`, `agent_stop`/`agent_start`) still raise the Altium window through `Client.ShowDocument` / script execution and steal his keyboard. Filed as an issue; until it is fixed, batch the document work and stop touching Altium the moment the proofs are in.
bridge-rs/Cargo.toml+1−1
@@ -1,6 +1,6 @@ [package] name = "altium-bridge"-version = "0.2.16"+version = "0.2.17" edition = "2021" description = "Adom altium-bridge — the bridge process, in Rust. Calls ab's verbs for the desktop; speaks file IPC to the resident DelphiScript agent inside Altium." license = "MIT"
bridge-rs/src/main.rs+1−1
@@ -25,7 +25,7 @@ mod win32; use std::time::Instant; use tiny_http::{Header, Method, Response, Server}; -pub const BRIDGE_VERSION: &str = "0.2.16";+pub const BRIDGE_VERSION: &str = "0.2.17";  fn json_response(status: u16, body: &serde_json::Value) -> Response<std::io::Cursor<Vec<u8>>> {     let data = serde_json::to_vec(body).unwrap_or_else(|_| b"{}".to_vec());
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "altium-bridge",-  "version": "0.2.16",+  "version": "0.2.17",   "type": "app",   "description": "Skills for your container so your AI knows how to drive the Altium Designer bridge (altium_* verbs). The bridge runtime itself is the release zip; Adom Bridge loads that.",   "tags": [
page.json+2−2
@@ -4,7 +4,7 @@   "type": "app",   "title": "Altium - the Altium Bridge",   "brief": "Adom Bridge for Altium Designer: a resident DelphiScript agent gives the AI eval, the 1,100-command process launcher, all 8 EDA surfaces with screenshots, compile/ERC, DRC, OutJob outputs, native SchLib/PcbLib authoring with STEP 3D bodies, and dialog handling by PID.",-  "version": "0.2.16",+  "version": "0.2.17",   "hero": {     "type": "image",     "path": "screenshots/hero.png"@@ -139,4 +139,4 @@     "skills/altium-wiki-import/SKILL.md",     "uninstall.sh"   ]-}\ No newline at end of file+}
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.2.16+0.2.17
src/agent/AdomAgent.pas.tmpl+9−6
@@ -1778,7 +1778,7 @@ Begin     Client.ShowDocument(SD);     Sheet := SchServer.GetCurrentSchDocument;     { Pass 1: MEASURE every part (union of its primitives' bounding rectangles, pins-      included, +400 mil a side for the pin-number text that hangs outside the stub).+      included, +250 mil a side for the pin-number text that hangs outside the stub).       John, 2026-09-19, reviewing three 5000 mil bodies squeezed onto one sheet:       "you are smooshing these symbols together such that their pin names overlap; no       real EE would ever do that, they'd space them out". So the sheet is sized FROM the@@ -1823,23 +1823,26 @@ Begin         End;         LibCmp.SchIterator_Destroy(PIt);         If BTop = 0 Then Begin BTop := BBT; BBot := BBB; End;-        PWs.Add(IntToStr((BBR - BBL) + 800));+        PWs.Add(IntToStr((BBR - BBL) + 500));         CXs.Add(IntToStr((BBL + BBR) Div 2));         CYs.Add(IntToStr((BBB + BBT) Div 2));         TPs.Add(IntToStr(BTop)); BTs.Add(IntToStr(BBot));-        TotalW := TotalW + (BBR - BBL) + 800;+        TotalW := TotalW + (BBR - BBL) + 500;         If (BBT - BBB) > MaxH Then MaxH := BBT - BBB;     End;     { Sheet from the parts: 1000 mil margins, at least 1500 mil of air between parts, and       room above (1700 mil description strip) and below (title block) the row. Sheet.SheetStyle       does NOT take on ADDevelop (measured 2026-09-19: the sheet stayed the 9500 x 7500 mil       default), so the sheet is a CUSTOM size, never smaller than A4 (11500 x 7600). }-    Gap := 1500; Margin := 1000;+    { John, 2026-09-19 (after the 1500 mil cut): "put those symbols a bit closer together so+      we get a better screenshot" - 500 mil of air between parts, 600 mil margins, and the+      sheet hugs the row so a zoom-all fills the frame. }+    Gap := 500; Margin := 600;     W := TotalW + Gap * (RefList.Count - 1) + 2 * Margin;     If W < 11500 Then W := 11500;-    H := MaxH + 4200;+    H := MaxH + 3600;     If H < 7600 Then H := 7600;-    If H * 17 < W * 9 Then H := (W * 9) Div 17;+    If H * 2 < W Then H := W Div 2;     Sheet.UseCustomSheet := True;     Sheet.CustomX := MilsToCoord(W);     Sheet.CustomY := MilsToCoord(H);
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "altium",   "displayName": "Altium Designer",-  "version": "0.2.16",+  "version": "0.2.17",   "description": "Drive Altium Designer from Adom: a resident DelphiScript agent (eval + the 1,100-command process launcher), the X2 -R command line, UIA over the VCL shell, dialogs by PID, screenshots of every Altium window, and Altium 365.",   "homepage": "https://wiki.adom.inc/adom/altium-bridge",   "docs": "https://wiki.adom.inc/adom/altium-bridge",