← Commit history
CHANGELOG.md+10
@@ -1,5 +1,15 @@ # Changelog +## 0.2.114++- **Placed parts keep their models** (#42). `altium_sch_place_part`, `altium_create_part_project`, `altium_place_on_sch` and `altium_build_schematic` rebuilt each part from its drawing, which dropped every model but the footprint (a SIM model, its STRESS model, ...) and copied each model's parameters (a SIM model's `Netlist` template, its `.MODEL` values) onto the part, some as visible text. They now place the part through Altium's own library placement, as the Components panel does: every model, only the part's own parameters, its part count and its library identity. A part placed this way simulates with its library model. Replies list the part's `models` and say how it was placed (`placement: library`); a library Altium cannot load still falls back to the rebuild (`placement: rebuilt`), now with only the part's own parameters.+- A footprint named in the call becomes the current one: the part's own of that name, else a new link. The library's other footprints stay as alternatives.+- **`altium_set_models` replaces only footprint models.** It removed every model on the symbol, a hand-made SIM model included. It now replaces only the PCBLIB models and answers which others it left (`kept`).+- `altium_edit_footprint` refuses a graphics entry that would draw nothing, naming the keys it did not read (`lines`, `items`, ...), before it changes anything: a `replace` without `shapes` only cleared the layer.+- `altium_library_views` on a `.PcbLib` gives the footprint and 3D views; a view a library cannot have (a symbol from a PcbLib, the device view, a 3D body a footprint lacks when no view was named) is `skipped` instead of failing the call.+- `altium_generate_body` reads a dimension given beside `family` (`pins: 2`) as well as in `dimensionsMm`, and says so (`dimensionsFromTopLevel`): a two-pin SOT-23 kept three leads.+- The schematic skill documents what a user measured about adding a SPICE model to a library symbol so it reaches an IntLib.+ ## 0.2.113  - **New verb `altium_layer_map`: your organisation's layers for the footprints the bridge makes** (#41). Map Adom's kinds of graphic (`overlay`, `fab`, `courtyard`, `body3d`, `comment`, `balls`, `centroid`, `designator`) to an Altium layer by type (`AssemblyTop`, `CourtyardTop`, `3DBodyTop`, ...), by name or by number. Set it per call (`layerMap`), for a library folder (`adom-layer-map.json` beside the library: the organisation's default) or as your own default; the call wins, then the folder, then yours. With nothing set, footprints come out exactly as before.
README.md+1−1
@@ -381,7 +381,7 @@ All 283 verbs, by area (prefix `altium_`). `altium_describe` returns the live ca - `altium_workspace_search`: Search the Altium 365 workspace's components (the shared cloud library Altium is signed in to) through Altium's own Components panel: name, description and footprint per result. - `altium_workspace_place`: Put a part from the Altium 365 workspace on a sheet: search, pick a result, place it (Altium's own placement, so the part keeps its workspace link, parameters and footprint), move it to x,y and name it. - `altium_sheet_params`: Write parameters onto PLACED parts on the schematic sheets (the BOM write-back): MPN, Manufacturer, Mouser/DigiKey/LCSC numbers, anything.-- `altium_sch_place_part`: Place a component from a .SchLib onto an EXISTING sheet at a position, with its library parameters (MPN, Manufacturer, distributor numbers) and its footprint link.+- `altium_sch_place_part`: Place a component from a .SchLib onto an EXISTING sheet at a position, through Altium's own library placement: it keeps every model (footprint, SIM, STRESS, ...), its own parameters (MPN, Manufacturer, distributor numbers), its part count and its library identity. - `altium_sch_swap_part`: Replace a placed part with another library part (a different value, package or symbol) at the same place, designator and rotation, keeping its connections: where a new pin ends elsewhere, a wire joins it to where the old pin ended. - `altium_sch_connect`: Connect pins of placed parts: a wire stub from each pin's outer end plus a net label (kind label), a power port (kind power: GND-like nets get a ground symbol) or the stub alone (kind wire); or mark a pin left open on purpose with a No ERC marker (kind noerc, no net). - `altium_sch_edit`: Change placed parts on a sheet: move (to x,y mil), moveBy (dx,dy), rotate (degrees), rename (designator), re-comment (comment), delete.
bridge-rs/src/body3d.rs+33
@@ -10,6 +10,10 @@ pub fn generate_body(args: &Value) -> Value {     let stem = std::path::Path::new(&path).file_stem().map(|s| s.to_string_lossy().to_string()).unwrap_or("body".into());     let mut eargs = args.clone();     eargs["name"] = json!(stem);+    // a dimension given beside family, not in dimensionsMm, was ignored without a word: pins: 2 left a SOT-23 at three+    // leads (#42). Such keys are read as dimensions, and the reply says so.+    let (lifted, dims) = lift_dimensions(args);+    if !lifted.is_empty() { eargs["dimensionsMm"] = dims; }     // the engine directly, not checks::engine: verb prefixing would walk the STEP text, and the hint is this bridge's own     let mut r = adom_eda_checks::run("generate_body", &json!({"args": eargs}));     let Some(text) = r.get("text").and_then(|t| t.as_str()).map(str::to_string) else { return r };@@ -17,12 +21,41 @@ pub fn generate_body(args: &Value) -> Value {     if let Err(e) = std::fs::write(&path, text) { return json!({"success": false, "errorCode": "write_failed", "error": format!("{path}: {e}")}); }     if let Some(o) = r.as_object_mut() { o.remove("text"); }     r["stepPath"] = json!(path);+    if !lifted.is_empty() { r["dimensionsFromTopLevel"] = json!(lifted); }     r["_hint"] = json!("The body is in the package's own frame (IPC-7351 zero orientation, pin 1 top-left, seated on z = 0), ready for altium_add_body {libraryPath, footprintName, step}. Compare bboxMm with the datasheet's body size before attaching it.");     r } +/// Dimension keys the engine reads (the JEDEC letters, pins, rows, cols) given at the top level instead of in+/// dimensionsMm: their names, and dimensionsMm with them added (one already in dimensionsMm wins).+fn lift_dimensions(args: &Value) -> (Vec<String>, Value) {+    const KEYS: &[&str] = &["pins", "rows", "cols", "A", "A1", "b", "c", "D", "D1", "D2", "E", "E1", "E2", "e", "L", "L1", "H", "W"];+    let mut dims = args.get("dimensionsMm").cloned().filter(|v| v.is_object()).unwrap_or_else(|| json!({}));+    let mut lifted = Vec::new();+    for k in KEYS {+        if let Some(v) = args.get(*k).filter(|v| v.is_number()) {+            if dims.get(*k).is_none() { dims[*k] = v.clone(); lifted.push(k.to_string()); }+        }+    }+    (lifted, dims)+}+ #[cfg(test)] mod tests {+    #[test]+    fn a_pin_count_beside_the_family_is_read() {+        let (l, d) = super::lift_dimensions(&serde_json::json!({"family": "sot23", "pins": 2, "dimensionsMm": {"e": 1.9}}));+        assert_eq!(l, vec!["pins"]);+        assert_eq!(d, serde_json::json!({"e": 1.9, "pins": 2}));+        let (l, _) = super::lift_dimensions(&serde_json::json!({"family": "soic", "pins": 2, "dimensionsMm": {"pins": 14}}));+        assert!(l.is_empty(), "dimensionsMm wins");+        let path = std::env::temp_dir().join("altium-body3d-2pin").join("D1.step");+        let r = super::generate_body(&serde_json::json!({"family": "sot23", "pins": 2, "outputPath": path.to_string_lossy()}));+        assert_eq!(r["solids"], serde_json::json!(3), "a body and two leads: {r}");+        assert_eq!(r["dimensionsFromTopLevel"], serde_json::json!(["pins"]));+        let _ = std::fs::remove_dir_all(path.parent().unwrap());+    }+     #[test]     fn the_engine_writes_the_body_this_bridge_saves() {         let dir = std::env::temp_dir().join("altium-body3d-test");
bridge-rs/src/library.rs+1−1
@@ -490,7 +490,7 @@ pub fn place_on_sch(args: &Value) -> Value {     let mut r = with_shot(agent::call("place_on_sch",         &[("sch", sch.clone()), ("libref", s_or(args, "symbolName", "CH340G")),           ("title", title.clone()), ("number", number.clone()), ("revision", revision.clone()),-          ("drawnBy", drawn.clone()), ("description", desc.clone())],+          ("drawnBy", drawn.clone()), ("description", desc.clone()), ("libraryPath", lib.replace('/', "\\"))],         None, timeout_of(args, 120)));     let missing: Vec<&str> = [("title", &title), ("number", &number), ("revision", &revision), ("drawnBy", &drawn), ("description", &desc)]         .iter().filter(|(_, v)| v.is_empty()).map(|(k, _)| *k).collect();
bridge-rs/src/main.rs+1−1
@@ -87,7 +87,7 @@ use tiny_http::{Header, Method, Response, Server}; /// Attached to every failed reply (see the /command handler). const REPORT_ISSUES: &str = "If this looks like an altium-bridge BUG (not a refusal you expected), report it: check for a duplicate with `adom-wiki issue list adom/altium-bridge`, then `adom-wiki issue create adom/altium-bridge --title \"<verb>: <one-line symptom>\" --category bug-report --body \"<what you ran, what you expected, what happened, the VERBATIM response JSON (and errorShot if present), bridgeVersion, the Altium version from altium_status, the OS>\"`. A relay, routing, toast or lifecycle problem belongs on adom/adom-bridge instead. Reports from real machines are how this bridge gets correct: three different Altium builds behaved three different ways in one weekend."; -pub const BRIDGE_VERSION: &str = "0.2.113";+pub const BRIDGE_VERSION: &str = "0.2.114";  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());
bridge-rs/src/project.rs+14−1
@@ -426,6 +426,10 @@ mod tests {         let (seq, _) = fp_ops(&json!({"renumber": {"sequential": true, "start": 1}}), &["A".into(), "B".into()]).unwrap();         assert_eq!(seq, ["PS|A|number|__adom0", "PS|B|number|__adom1", "PS|__adom0|number|1", "PS|__adom1|number|2"]);         assert!(fp_ops(&json!({"graphics": [{"layer": "Dwgs.User"}]}), &[]).is_err());+        // #42: a replace with its shapes under another key cleared the layer and drew nothing+        let e = fp_ops(&json!({"graphics": [{"layer": "F.SilkS", "mode": "replace", "lines": [[0, 0, 1, 1]]}]}), &[]).unwrap_err();+        assert!(e["error"].as_str().unwrap().contains("lines"), "{e}");+        assert!(fp_ops(&json!({"graphics": [{"layer": "F.SilkS", "mode": "delete"}]}), &[]).is_ok(), "delete needs no shapes");     }  @@ -540,6 +544,15 @@ pub(crate) fn fp_ops(args: &Value, pads_now: &[String]) -> Result<(Vec<String>,         let ln = g.get("layer").and_then(|v| v.as_str()).unwrap_or("");         let lid = fp_graphics_layer(ln).ok_or_else(|| bad(format!("graphics layer {ln}: F.SilkS, F.Fab, F.CrtYd, F.Mask, F.Paste (or B.), Mechanical<n>, L<id>")))?;         let mode = g.get("mode").and_then(|v| v.as_str()).unwrap_or("append");+        if !["append", "replace", "delete"].contains(&mode) { return Err(bad(format!("graphics mode {mode}: append, replace or delete"))); }+        // shapes go in `shapes`: an entry with none drew nothing, and replace then only cleared the layer (#42)+        let unknown: Vec<String> = g.as_object().map(|o| o.keys().filter(|k| !["layer", "mode", "widthMm", "shapes"].contains(&k.as_str())).cloned().collect()).unwrap_or_default();+        let has_shapes = g.get("shapes").and_then(|v| v.as_array()).is_some_and(|a| !a.is_empty());+        if mode != "delete" && !has_shapes {+            return Err(bad(format!("graphics on {ln} has no shapes{}: give shapes: [{{type: line|arc|rect|circle|poly, ...}}] (mode delete clears the layer); nothing was changed",+                if unknown.is_empty() { String::new() } else { format!(" (not read: {})", unknown.join(", ")) })));+        }+        if !unknown.is_empty() { return Err(bad(format!("graphics on {ln}: {} not read; shapes go in shapes: [{{type, ...}}]; nothing was changed", unknown.join(", ")))); }         if mode == "replace" || mode == "delete" { ops.push(format!("GD|{lid}")); }         if mode == "delete" { continue; }         let w = g.get("widthMm").and_then(|v| v.as_f64()).unwrap_or(0.12);@@ -699,7 +712,7 @@ pub fn create_part_project(args: &Value) -> Value {     for l in [&lib, &fp_lib] { if let Err(e) = crate::hier::add_to_project(&prj, l) { return e; } }     let _ = crate::surfaces::open_document(&json!({"filePath": prj}));     let placed = crate::sch::place_part(&json!({"sheet": sch, "library": lib, "symbol": part, "designator": "U1", "x": 4000, "y": 4000, "footprint": fp, "pcbLib": fp_lib}));-    steps.push(json!({"symbolPlaced": placed.get("success"), "detail": placed.get("error")}));+    steps.push(json!({"symbolPlaced": placed.get("success"), "detail": placed.get("error"), "placement": placed.get("placement"), "models": placed.get("models")}));     if placed.get("success").and_then(|b| b.as_bool()) != Some(true) { return json!({"success": false, "errorCode": "place_failed", "error": "the symbol could not be placed", "reply": placed, "project": prj}); }     let up = crate::sch::update_pcb(&json!({"projectPath": prj, "execute": true}));     steps.push(json!({"updatePcb": up.get("executed"), "detail": up.get("error")}));
bridge-rs/src/render.rs+15−6
@@ -207,11 +207,15 @@ pub fn library_views(args: &Value) -> Value {     let Some(lib) = support::s(args, "libraryPath") else { return bad("libraryPath (.SchLib or .PcbLib) is required") };     let parts: Vec<String> = args.get("parts").and_then(|v| v.as_array()).map(|a| a.iter().filter_map(|x| x.as_str().map(str::to_string)).collect()).unwrap_or_default();     if parts.is_empty() { return bad("parts: [part name] is required"); }-    let views: Vec<String> = args.get("views").and_then(|v| v.as_array()).map(|a| a.iter().filter_map(|x| x.as_str().map(str::to_string)).collect()).unwrap_or(vec!["symbol".into(), "footprint".into(), "3d".into(), "device".into()]);+    let is_sch = lib.to_lowercase().ends_with(".schlib");+    // the views a library of this kind has, unless the caller names them: a PcbLib has no symbol, and asking it for one+    // made the whole call fail while the footprint rendered (#42)+    let asked: Option<Vec<String>> = args.get("views").and_then(|v| v.as_array()).map(|a| a.iter().filter_map(|x| x.as_str().map(str::to_string)).collect());+    let explicit = asked.is_some();+    let views: Vec<String> = asked.unwrap_or_else(|| if is_sch { vec!["symbol".into(), "footprint".into(), "3d".into(), "device".into()] } else { vec!["footprint".into(), "3d".into()] });     let dir = Path::new(&lib).parent().unwrap_or(Path::new(".")).to_path_buf();     let out = support::s(args, "outputDir").map(PathBuf::from).unwrap_or_else(|| dir.join("views"));     let _ = std::fs::create_dir_all(&out);-    let is_sch = lib.to_lowercase().ends_with(".schlib");     let sch_streams = if is_sch { std::fs::read(&lib).ok().and_then(|b| crate::schdoc::cfb_streams(&b).ok()) } else { None };     let mut captured = Vec::new();     for part in &parts {@@ -223,16 +227,20 @@ pub fn library_views(args: &Value) -> Value {             let mut row = json!({"part": part, "view": view, "path": path.to_string_lossy(), "ok": false});             let r = match view.as_str() {                 "symbol" if is_sch => crate::surfaces::show_symbol(&json!({"libraryPath": lib, "symbolName": part})),-                "symbol" => { row["error"] = json!("a .PcbLib holds footprints only: give the .SchLib for the symbol"); captured.push(row); continue; }+                "symbol" => { row["error"] = json!("a .PcbLib holds footprints only: give the .SchLib for the symbol"); row["skipped"] = json!(true); captured.push(row); continue; }                 "footprint" | "3d" => {                     let (Some(f), Some(l)) = (fp.as_ref(), fp_lib.as_ref()) else { row["error"] = json!("no footprint found for the part (its model link, or a .PcbLib beside the library that holds it)"); captured.push(row); continue; };                     if view == "3d" {                         let rf = crate::project::read_footprint(&json!({"libraryPath": l, "name": f}));-                        if rf["models"].as_array().map(|m| m.is_empty()).unwrap_or(true) { row["error"] = json!(format!("{f} has no 3D body: add one (altium_add_body)")); captured.push(row); continue; }+                        if rf["models"].as_array().map(|m| m.is_empty()).unwrap_or(true) {+                            row["error"] = json!(format!("{f} has no 3D body: add one (altium_add_body)"));+                            if !explicit { row["skipped"] = json!(true); }+                            captured.push(row); continue;+                        }                         crate::surfaces::show_3d_chip(&json!({"libraryPath": l, "footprintName": f}))                     } else { crate::surfaces::show_footprint(&json!({"libraryPath": l, "footprintName": f})) }                 }-                "device" => { row["error"] = json!("Altium has no device view: the symbol-pin to footprint-pad map is altium_pin_pad_check"); captured.push(row); continue; }+                "device" => { row["error"] = json!("Altium has no device view: the symbol-pin to footprint-pad map is altium_pin_pad_check"); row["skipped"] = json!(true); captured.push(row); continue; }                 o => { row["error"] = json!(format!("view {o}: symbol, footprint, 3d or device")); captured.push(row); continue; }             };             match save_shot(&r, &path) {@@ -242,7 +250,8 @@ pub fn library_views(args: &Value) -> Value {             captured.push(row);         }     }-    let all_ok = captured.iter().all(|c| c["ok"] == json!(true) || c["view"] == "device");+    // a view the library cannot have is skipped, not failed; at least one picture must have come out+    let all_ok = captured.iter().all(|c| c["ok"] == json!(true) || c["skipped"] == json!(true)) && captured.iter().any(|c| c["ok"] == json!(true));     json!({"success": all_ok, "captured": captured, "outputDir": out.to_string_lossy(), "windowEtiquette": "background",         "_hint": "Each picture is Altium's own editor captured in the background (no foreground). The device view (symbol pins mapped to pads) is altium_pin_pad_check on Altium."}) }
bridge-rs/src/sch.rs+10−3
@@ -102,11 +102,18 @@ pub fn place_part(args: &Value) -> Value {     let p = |k: &str| s(args, k).map(|v| clean(&v)).unwrap_or_default();     let n = |k: &str| args.get(k).and_then(|v| v.as_f64()).map(|v| (v.round() as i64).to_string()).unwrap_or_default();     let r = agent::call("sch_place_part", &[("libref", sym.clone()), ("sch", sheet.clone()), ("designator", p("designator")), ("x", n("x")), ("y", n("y")),-        ("rotation", n("rotation")), ("comment", p("comment")), ("partId", n("partId")), ("footprint", p("footprint")), ("pcblib", p("pcbLib"))], None, timeout_of(args, 90));+        ("rotation", n("rotation")), ("comment", p("comment")), ("partId", n("partId")), ("footprint", p("footprint")), ("pcblib", p("pcbLib")),+        ("libraryPath", lib.replace('/', "\\"))], None, timeout_of(args, 90));     let d = match agent_data(&r) { Ok(d) => d, Err(e) => return e };     let saved = maybe_save(args, &sheet);-    json!({"success": true, "sheet": sheet, "designator": d["designator"], "libref": d["libref"], "pins": d["pins"], "footprints": d["footprints"], "atMil": d["atMil"], "saved": saved,-        "_hint": "Placed with its library parameters and footprint link. Wire it with altium_sch_connect {designator, pin, net}; a '?' designator is filled by altium_annotate; the board gets the part with altium_update_pcb."})+    let rebuilt = d["placement"] == "rebuilt";+    json!({"success": true, "sheet": sheet, "designator": d["designator"], "libref": d["libref"], "pins": d["pins"], "footprints": d["footprints"],+        "models": d["models"], "placement": d["placement"], "atMil": d["atMil"], "saved": saved,+        "_hint": if rebuilt {+            "Altium could not load the part from the library, so it was rebuilt from its primitives: it carries its parameters and footprint, but no simulation or other models. Wire it with altium_sch_connect {designator, pin, net}."+        } else {+            "Placed by Altium's own library placement: the part keeps every model (models), its parameters and its library identity. Wire it with altium_sch_connect {designator, pin, net}; a '?' designator is filled by altium_annotate; the board gets the part with altium_update_pcb."+        }}) }  /// altium_sch_zoom {sheet, designators}: select those parts on the sheet and frame them, with a proof frame.
bridge-rs/src/verbs.rs+4−4
@@ -146,8 +146,8 @@ fn describe() -> Value {             json!({"libraryPath": "path (.SchLib)", "symbolName": "string", "models": "bool, default false (the model walk halts the engine on some builds)"}), json!({"pins": "int", "rectangles": "int", "lines": "int", "polylines": "int", "bodyRectMil": "[l, b, r, t] - the union of the current display mode's rectangles (mode 0, as a sheet draws it)", "polyBboxMil": "[..]", "models": "[\"PCBLIB:NAME\"]"}), 60,             "polylines should equal what add_symbol_art reported and polyBboxMil should sit inside bodyRectMil.", &["add_symbol_art", "set_models", "read_symbol"], &[], json!({})),         verb_doc("set_models", "Replace every footprint model on a SchLib component with ONE PCBLIB model (set_params footprint and add_models APPEND, which is how a symbol ends up with two).",-            json!({"libraryPath": "path (.SchLib)", "symbolName": "string", "footprint": "string (PcbLib footprint name)"}), json!({"removed": "int", "footprint": "string"}), 60,-            "altium_save the SchLib afterwards.", &["symbol_prims", "set_params", "add_models"], &["Removes every existing model, including 3D-only ones."], json!({})),+            json!({"libraryPath": "path (.SchLib)", "symbolName": "string", "footprint": "string (PcbLib footprint name)"}), json!({"removed": "int: the footprint (PCBLIB) models replaced", "kept": "[model type]: the other models left as they were (SIM, STRESS, PCB3D, ...)", "footprint": "string"}), 60,+            "altium_save the SchLib afterwards. Only footprint models are replaced: a simulation or signal-integrity model stays.", &["symbol_prims", "set_params", "add_models"], &["Before 0.2.114 it removed every model, simulation models included (#42)."], json!({})),         verb_doc("add_symbol_art", "Draw the chip-outline artwork (the chip-thumbnailer polylines adom-symbol baked into the KiCad symbol) into a SchLib component, fitted to its body rectangle, so the Altium symbol shows the same chip as KiCad and Fusion.",             json!({"libraryPath": "path (.SchLib)", "symbolName": "string (LibReference)", "kicadSym": "Windows path to the .kicad_sym that carries the baked outline (stage it with send_files)", "clear": "bool, default true: remove the component's existing polylines/lines first", "mode": "lines (default) | polyline"}),             json!({"polylines": "int", "points": "int", "bodyRectMil": "[x0,y0,x1,y1]"}), 180,@@ -793,9 +793,9 @@ fn describe() -> Value {             &["sheet_params", "export_manufacturing", "read_schematic"],             &["Graphical, Net Tie (no BOM) and Standard (no BOM) components are left out (checks.excludedKinds).", "DNP: a variant's Not Fitted parts, or a DNP / Do Not Populate / Fitted=false parameter.", "Variants are read from the .PrjPcb text; alternate parts are listed, not substituted.", "CPL rotations are Altium's: JLCPCB's preview may need per-footprint corrections.", "A multi-channel (repeated) sheet is read once: its copies' designators land in checks.boardNotOnSheet.", "Only the parameters a BOM needs are read (some libraries carry huge blob parameters); a workspace-managed part's description comes from a Description parameter, never its vault."],             json!({"projectPath": "C:/proj/board.PrjPcb", "boards": 10})),-        verb_doc("sch_place_part", "Place a component from a .SchLib onto an EXISTING sheet at a position, with its library parameters (MPN, Manufacturer, distributor numbers) and its footprint link.",+        verb_doc("sch_place_part", "Place a component from a .SchLib onto an EXISTING sheet at a position, through Altium's own library placement: it keeps every model (footprint, SIM, STRESS, ...), its own parameters (MPN, Manufacturer, distributor numbers), its part count and its library identity.",             json!({"sheet": "path to the .SchDoc (required)", "library": "path to the .SchLib (required)", "symbol": "the component's name in that library (required)", "designator": "string, default the library's (e.g. R?)", "x": "mil, default 1000 (snapped to 100)", "y": "mil, default 1000", "rotation": "0|90|180|270", "comment": "string, default the library's", "partId": "int, default 1 (a multi-part component's part)", "footprint": "a PcbLib footprint name to link instead of the library's own", "pcbLib": "path of the .PcbLib the footprint lives in (optional)", "save": "bool, default true"}),-            json!({"designator": "string", "libref": "string", "pins": "int", "footprints": "[string]", "atMil": "[x, y]", "saved": "bool"}), 120,+            json!({"designator": "string", "libref": "string", "pins": "int", "footprints": "[string]", "models": "[model type]: every model the placed part carries", "placement": "library | rebuilt (Altium could not load the library: no simulation or other models)", "atMil": "[x, y]", "saved": "bool"}), 120,             "Then wire it: altium_sch_connect {sheet, connections:[{designator, pin, net}]}; number a '?' designator with altium_annotate; push it to the board with altium_update_pcb.",             &["sch_connect", "annotate", "update_pcb", "list_library"],             &["Places part 1 of a multi-part component unless partId says otherwise.", "Sheet coordinates are mils from the sheet's lower-left corner; altium_schematic_data shows where the other parts are."],
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "altium-bridge",-  "version": "0.2.113",+  "version": "0.2.114",   "type": "app",   "description": "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.",   "tags": [
page.json+2−2
@@ -4,7 +4,7 @@   "type": "app",   "title": "Altium Bridge: AI for Altium Designer",   "brief": "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.",-  "version": "0.2.113",+  "version": "0.2.114",   "hero": {     "type": "image",     "path": "screenshots/hero.png"@@ -159,4 +159,4 @@     "tools/symbol_modes.py",     "uninstall.sh"   ]-}\ No newline at end of file+}
skills/altium-schematic-edit/SKILL.md+21−2
@@ -29,8 +29,12 @@ altium_update_pcb     '{"projectPath":"C:\\proj\\board.PrjPcb"}' altium_update_pcb     '{"projectPath":"C:\\proj\\board.PrjPcb","execute":true,"timeout":600}' ``` -- `sch_place_part` copies the library part's drawing, parameters (MPN, Manufacturer, distributor numbers)-  and footprint links. `footprint` + `pcbLib` link a different footprint. Coordinates snap to 100 mil.+- `sch_place_part` places the part through Altium's own library placement (0.2.114, #42): it keeps every model+  (footprint, SIM, STRESS, ...; `models` lists them), only its own parameters, its part count and its library identity,+  as the Components panel does. `footprint` + `pcbLib` make a different footprint the current one. Coordinates snap to+  100 mil. `placement: "rebuilt"` means Altium could not load the library and the part was rebuilt from its primitives:+  it then carries no simulation or other models. `place_on_sch`, `create_part_project` and `build_schematic` place the+  same way. - `sch_connect` draws a wire stub (default 200 mil) out of each pin's end and puts a net label on it   (`kind:"label"`), a power port (`kind:"power"`; GND, AGND, VSS... get a ground symbol, other nets a   bar) or nothing (`kind:"wire"`). Pins are matched by number first, then by name. Each connection@@ -239,6 +243,21 @@ altium_export_spice '{"schematic":"C:/proj/Amp.SchDoc","outputPath":"C:/proj/Amp   `simulation_failed` (usually a part without a simulation model; Altium's Messages name it), `no_project` (the sheet   must belong to a `.PrjPcb` beside it), `not_supported` for raw SPICE analyses. +### A SPICE model on a library symbol (no verb yet; measured by a user on AD 26, #42)++- **A scripted SIM implementation is not enough for an IntLib.** `AddSchImplementation` with ModelType `SIM`, a model+  name and `AddDataFileLink(name, file.mdl, 'MDL')` saves, and a placed part simulates, but the IntLib compiler does+  not pack it (no `MDL/` stream, no SIM entry in `LibCrossRef.Txt`).+- **Altium's Sim Model dialog writes the form that packs**: `ModelDatafile0=<full path>.mdl`, `ModelDatafileKind0=mdl`+  (lower case), parameters on the implementation (`Kind`, `SubKind`, `Spice Prefix`, `Netlist` template, `Syntax`,+  `Source=Local`, and every `.MODEL` parameter as its own parameter), plus a separate `STRESS` implementation. Add the+  model through the dialog when it must reach an IntLib.+- Vendor SPICE files often have an uncommented title line before `.MODEL`: strip it to a clean `.mdl`, and add the+  `.mdl` to the LibPkg as a document.+- SPICE diode nodes are anode, cathode: with the cathode on pin 1, map symbol pin 1 to model node 2 and pin 2 to node 1.+- `altium_set_models` replaces only footprint models (0.2.114): a SIM or STRESS model stays.+- A simulation run opens its own window with a second Altium taskbar icon; it is not a second Altium.+ ## Title block and PDF  ```bash
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.2.113+0.2.114
src/agent/AdomAgent.pas.tmpl+231−20
@@ -2487,8 +2487,9 @@ Var     Iter  : ISch_Iterator;     Comp  : ISch_Component;     Impl  : ISch_Implementation;-    Name, Fp : String;+    Name, Fp, Kept : String;     Removed : Integer;+    Found : Boolean; Begin     Name := Param(Lines, 'libref');     Fp := Param(Lines, 'footprint');@@ -2515,17 +2516,36 @@ Begin     End;     Removed := 0;     { Same rule as CmdSymbolPrims: walk implementations with the eImplementation iterator. One-      iterator per removal, because removing under a live iterator invalidates it. }+      iterator per removal, because removing under a live iterator invalidates it. Only footprint (PCBLIB) models go:+      removing every model took a user's hand-made SIM and STRESS models with it (#42). }     While Removed < 64 Do     Begin+        Found := False;         Iter := Comp.SchIterator_Create;         Iter.AddFilter_ObjectSet(MkSet(eImplementation));         Impl := Iter.FirstSchObject;+        While Impl <> Nil Do+        Begin+            If UpperCase(Impl.ModelType) = 'PCBLIB' Then Begin Found := True; Break; End;+            Impl := Iter.NextSchObject;+        End;         Comp.SchIterator_Destroy(Iter);-        If Impl = Nil Then Break;+        If Not Found Then Break;         Comp.RemoveSchImplementation(Impl);         Removed := Removed + 1;     End;+    { the models left in place, by type (SIM, STRESS, PCB3D, ...) }+    Kept := '';+    Iter := Comp.SchIterator_Create;+    Iter.AddFilter_ObjectSet(MkSet(eImplementation));+    Impl := Iter.FirstSchObject;+    While Impl <> Nil Do+    Begin+        If Kept <> '' Then Kept := Kept + ',';+        Kept := Kept + '"' + JsonEsc(Impl.ModelType) + '"';+        Impl := Iter.NextSchObject;+    End;+    Comp.SchIterator_Destroy(Iter);     If Fp <> '' Then     Begin         Impl := Comp.AddSchImplementation;@@ -2536,7 +2556,42 @@ Begin         Impl.IsCurrent := True;     End;     SLib.GraphicallyInvalidate;-    Result := '{' + JRaw('ok', 'true') + ',' + JStr('libref', Comp.LibReference) + ',' + JRaw('removed', IntToStr(Removed)) + ',' + JStr('footprint', Fp) + '}';+    Result := '{' + JRaw('ok', 'true') + ',' + JStr('libref', Comp.LibReference) + ',' + JRaw('removed', IntToStr(Removed)) + ',' + JRaw('kept', '[' + Kept + ']') + ',' + JStr('footprint', Fp) + '}';+End;++{ A library part as Altium's own library placement makes it: every implementation (footprint, SIM, STRESS, ...), only+  its own parameters, its part count and its DesignItemId. The bridge used to rebuild a part from its primitives, which+  dropped every model but the footprint and copied each model's parameters onto the part as visible text (#42).+  Nil when the library cannot be loaded (the caller rebuilds). }+Function LoadLibComp(LibPath, LibRef : String) : ISch_Component;+Begin+    Result := Nil;+    If (LibPath = '') Or (LibRef = '') Then Exit;+    Try+        Result := SchServer.LoadComponentFromLibrary(LibRef, LibPath);+    Except+        Result := Nil;+    End;+End;++{ The model types a placed part carries, as a JSON array: ["PCBLIB","SIM","STRESS"]. }+Function ImplTypesJson(C : ISch_Component) : String;+Var+    IIt : ISch_Iterator;+    Impl : ISch_Implementation;+Begin+    Result := '';+    IIt := C.SchIterator_Create;+    IIt.AddFilter_ObjectSet(MkSet(eImplementation));+    Impl := IIt.FirstSchObject;+    While Impl <> Nil Do+    Begin+        If Result <> '' Then Result := Result + ',';+        Result := Result + '"' + JsonEsc(Impl.ModelType) + '"';+        Impl := IIt.NextSchObject;+    End;+    C.SchIterator_Destroy(IIt);+    Result := '[' + Result + ']'; End;  Function CmdPlaceOnSch(Lines : TStringList) : String;@@ -2565,6 +2620,8 @@ Var     LRect  : ISch_Rectangle;     Pm     : ISch_Parameter;     TF     : ISch_TextFrame;+    LibPath, Hows : String;+    Loaded : Boolean; Begin     SchPath := Param(Lines, 'sch');     LibRef := Param(Lines, 'libref');@@ -2748,7 +2805,7 @@ Begin         GapA := Gap + (W - (TotalW + Gap * (RefList.Count - 1) + 2 * Margin)) Div (RefList.Count + 1);         MarginA := (W - TotalW - GapA * (RefList.Count - 1)) Div 2;     End;-    Placed := '';+    Placed := ''; Hows := '';     NCopied := 0;     Cur := MarginA;     If Append Then Cur := ExtX + 4000;@@ -2775,16 +2832,9 @@ Begin         LibCmp := Iter.NextSchObject;     End;     SLib.SchIterator_Destroy(Iter);-    { Build a fresh component instance and copy the library part's primitives into it.-      ISch_Component.Replicate does NOT re-parent the pins/rectangle onto a normal-      sheet (measured 2026-08-30: only the designator/comment text placed), so copy-      each child primitive with primitive-level Replicate + AddSchObject. }-    Inst := SchServer.SchObjectFactory(eSchComponent, eCreate_Default);-    Inst.CurrentPartID := 1;-    Inst.DisplayMode := 0;-    Inst.LibReference := LibCmp.LibReference;-    Inst.ComponentDescription := LibCmp.ComponentDescription;-    Inst.Location := Point(MilsToCoord(XK), MilsToCoord(YK));+    { Altium's own library placement first (#42): the part keeps every model, its own parameters and its identity.+      Only when the library cannot be loaded is a fresh instance built and the library part's primitives copied in+      (ISch_Component.Replicate does NOT re-parent the pins/rectangle onto a normal sheet, measured 2026-08-30). }     { body rectangle centre (mil, library frame) for the designator / comment columns }     BCX := AdomInt(CXs[K]); BCY := AdomInt(CYs[K]);     RIt := LibCmp.SchIterator_Create;@@ -2793,6 +2843,30 @@ Begin     If LRect <> Nil Then         BCX := Round(CoordToMils(LRect.Location.X + LRect.Corner.X) / 2);     LibCmp.SchIterator_Destroy(RIt);+    LibPath := Param(Lines, 'libraryPath');+    If LibPath = '' Then LibPath := SLib.DocumentName;+    Inst := LoadLibComp(LibPath, LibCmp.LibReference);+    Loaded := Inst <> Nil;+    If Loaded Then+    Begin+        If Hows <> '' Then Hows := Hows + ',';+        Hows := Hows + '"library"';+        Sheet.AddSchObject(Inst);+        Inst.CurrentPartID := 1;+        { the loaded part sits on the library's origin: moving it by the measured offset puts it where the copied+          primitives went }+        Inst.MoveToXY(MilsToCoord(DX), MilsToCoord(DY));+    End+    Else+    Begin+    If Hows <> '' Then Hows := Hows + ',';+    Hows := Hows + '"rebuilt"';+    Inst := SchServer.SchObjectFactory(eSchComponent, eCreate_Default);+    Inst.CurrentPartID := 1;+    Inst.DisplayMode := 0;+    Inst.LibReference := LibCmp.LibReference;+    Inst.ComponentDescription := LibCmp.ComponentDescription;+    Inst.Location := Point(MilsToCoord(XK), MilsToCoord(YK));     PIt := LibCmp.SchIterator_Create;     Prim := PIt.FirstSchObject;     While Prim <> Nil Do@@ -2814,6 +2888,7 @@ Begin         Prim := PIt.NextSchObject;     End;     LibCmp.SchIterator_Destroy(PIt);+    End;     { Designator centred ABOVE the body and the comment centred BELOW it, whatever the       library part did with them (measured 2026-09-19: +200 mil put U1 on top of the chip       outline inside a 3700 mil body). }@@ -2826,7 +2901,7 @@ Begin     Inst.Comment.IsHidden := False;     Inst.Comment.Justification := eJustify_TopCenter;     Inst.Comment.Location := Point(MilsToCoord(BCX + DX), MilsToCoord(AdomInt(BTs[K]) + DY - 100));-    Sheet.RegisterSchObjectInContainer(Inst);+    If Not Loaded Then Sheet.RegisterSchObjectInContainer(Inst);     SchServer.RobotManager.SendMessage(Sheet.I_ObjectAddress, c_BroadCast, SCHM_PrimitiveRegistration, Inst.I_ObjectAddress);     If Placed <> '' Then Placed := Placed + ';';     Placed := Placed + RefList[K];@@ -2893,7 +2968,7 @@ Begin     PWs.Free; CXs.Free; CYs.Free; TPs.Free; BTs.Free;     Result := '{' + JRaw('ok','true') + ',' + JStr('sch', SchPath) + ',' + JRaw('sheetMil', '[' + IntToStr(W) + ',' + IntToStr(H) + ']') + ',' +         JRaw('titleBlock', '{' + JRaw('title', BoolStr(Title <> '')) + ',' + JRaw('number', BoolStr(DocNum <> '')) + ',' + JRaw('revision', BoolStr(Rev <> '')) + ',' + JRaw('drawnBy', BoolStr(Drawn <> '')) + ',' + JRaw('description', BoolStr(Desc <> '')) + '}') + ',' +-        JStr('placed', Placed) + ',' + JStr('designator','U' + IntToStr(NExist + 1)) + ',' + JRaw('appended', BoolStr(Append)) + ',' + JRaw('sheetGrown', BoolStr(Grown)) + ',' + JRaw('existingParts', IntToStr(NExist)) + ',' + JRaw('count', IntToStr(RefList.Count)) + ',' + JRaw('primitives', IntToStr(NCopied)) + '}';+        JStr('placed', Placed) + ',' + JStr('designator','U' + IntToStr(NExist + 1)) + ',' + JRaw('appended', BoolStr(Append)) + ',' + JRaw('sheetGrown', BoolStr(Grown)) + ',' + JRaw('existingParts', IntToStr(NExist)) + ',' + JRaw('count', IntToStr(RefList.Count)) + ',' + JRaw('primitives', IntToStr(NCopied)) + ',' + JRaw('placement', '[' + Hows + ']') + '}';     RefList.Free; End; @@ -9165,7 +9240,8 @@ Var     Prm    : ISch_Parameter;     SD     : IServerDocument;     Sheet  : ISch_Document;-    SchPath, Fp, Models : String;+    SchPath, Fp, Models, LibPath, How : String;+    HasFp : Boolean;     DX, DY, Part, K, Rot, NPins : Integer; Begin     SLib := SchServer.GetCurrentSchDocument;@@ -9187,6 +9263,87 @@ Begin     DX := (StrToIntDef(Param(Lines, 'x'), 1000) Div 100) * 100;     DY := (StrToIntDef(Param(Lines, 'y'), 1000) Div 100) * 100;     SchServer.ProcessControl.PreProcess(Sheet, '');+    { Altium's own library placement first (#42): the part keeps its models, parameters and identity }+    LibPath := Param(Lines, 'libraryPath');+    If LibPath = '' Then LibPath := SLib.DocumentName;+    Inst := LoadLibComp(LibPath, LibCmp.LibReference);+    If Inst <> Nil Then+    Begin+        How := 'library';+        If (Part < 1) Or (Part > LibCmp.PartCount) Then Part := 1;+        Sheet.AddSchObject(Inst);+        Inst.CurrentPartID := Part;+        Inst.MoveToXY(MilsToCoord(DX), MilsToCoord(DY));+        NPins := 0;+        PIt := Inst.SchIterator_Create;+        PIt.AddFilter_ObjectSet(MkSet(ePin));+        Prim := PIt.FirstSchObject;+        While Prim <> Nil Do+        Begin+            If (Prim.OwnerPartId = Part) Or (Prim.OwnerPartId = 0) Then NPins := NPins + 1;+            Prim := PIt.NextSchObject;+        End;+        Inst.SchIterator_Destroy(PIt);+        { a footprint named in the call becomes the current one (the part's own of that name, else a new link); the+          library's others stay as alternatives }+        Fp := Param(Lines, 'footprint');+        HasFp := False;+        If Fp <> '' Then+        Begin+            PIt := Inst.SchIterator_Create;+            PIt.AddFilter_ObjectSet(MkSet(eImplementation));+            Impl := PIt.FirstSchObject;+            While Impl <> Nil Do+            Begin+                If UpperCase(Impl.ModelType) = 'PCBLIB' Then+                Begin+                    Impl.IsCurrent := (Not HasFp) And (UpperCase(Impl.ModelName) = UpperCase(Fp));+                    If Impl.IsCurrent Then HasFp := True;+                End;+                Impl := PIt.NextSchObject;+            End;+            Inst.SchIterator_Destroy(PIt);+        End;+        If (Fp <> '') And (Not HasFp) Then+        Begin+            NImpl := Inst.AddSchImplementation;+            NImpl.ClearAllDatafileLinks;+            NImpl.Description := 'Footprint';+            NImpl.ModelName := Fp;+            NImpl.ModelType := 'PCBLIB';+            NImpl.AddDataFileLink(Fp, Param(Lines, 'pcblib'), 'PCBLIB');+            NImpl.IsCurrent := True;+        End;+        Models := '';+        PIt := Inst.SchIterator_Create;+        PIt.AddFilter_ObjectSet(MkSet(eImplementation));+        Impl := PIt.FirstSchObject;+        While Impl <> Nil Do+        Begin+            If UpperCase(Impl.ModelType) = 'PCBLIB' Then+            Begin+                If Models <> '' Then Models := Models + ',';+                Models := Models + '"' + JsonEsc(Impl.ModelName) + '"';+            End;+            Impl := PIt.NextSchObject;+        End;+        Inst.SchIterator_Destroy(PIt);+        If Param(Lines, 'designator') <> '' Then Inst.Designator.Text := Param(Lines, 'designator');+        Inst.Designator.IsHidden := False;+        If Param(Lines, 'comment') <> '' Then Inst.Comment.Text := Param(Lines, 'comment');+        SchServer.RobotManager.SendMessage(Sheet.I_ObjectAddress, c_BroadCast, SCHM_PrimitiveRegistration, Inst.I_ObjectAddress);+        Rot := (StrToIntDef(Param(Lines, 'rotation'), 0) Div 90) Mod 4;+        For K := 1 To Rot Do Inst.RotateBy90(Inst.Location, eRotate90);+        SchServer.ProcessControl.PostProcess(Sheet, '');+        MarkSchModified(Sheet);+        Sheet.GraphicallyInvalidate;+        Result := '{' + JRaw('ok','true') + ',' + JStr('document', Sheet.DocumentName) + ',' + JStr('designator', Inst.Designator.Text) + ',' ++            JStr('libref', LibCmp.LibReference) + ',' + JRaw('pins', IntToStr(NPins)) + ',' + JRaw('footprints', '[' + Models + ']') + ',' ++            JRaw('models', ImplTypesJson(Inst)) + ',' + JStr('placement', How) + ',' ++            JRaw('atMil', '[' + IntToStr(DX) + ',' + IntToStr(DY) + ']') + '}';+        Exit;+    End;+    How := 'rebuilt';     Inst := SchServer.SchObjectFactory(eSchComponent, eCreate_Default);     { a multi-part symbol needs its part count on the instance first, or the part is clamped to 1 and the sheet reads       part 2 back as part 1 (2026-10-22, dual op-amp) }@@ -9219,7 +9376,10 @@ Begin         Prim := PIt.NextSchObject;     End;     LibCmp.SchIterator_Destroy(PIt);+    { the part's own parameters only: a deep walk also returns each model's parameters (a SIM model's Netlist and+      .MODEL values), which landed on the part as visible text (#42) }     PIt := LibCmp.SchIterator_Create;+    PIt.SetState_IterationDepth(eIterateFirstLevel);     PIt.AddFilter_ObjectSet(MkSet(eParameter));     Prm := PIt.FirstSchObject;     While Prm <> Nil Do@@ -9288,6 +9448,7 @@ Begin     Sheet.GraphicallyInvalidate;     Result := '{' + JRaw('ok','true') + ',' + JStr('document', Sheet.DocumentName) + ',' + JStr('designator', Inst.Designator.Text) + ',' +         JStr('libref', LibCmp.LibReference) + ',' + JRaw('pins', IntToStr(NPins)) + ',' + JRaw('footprints', '[' + Models + ']') + ',' ++        JRaw('models', ImplTypesJson(Inst)) + ',' + JStr('placement', How) + ',' +         JRaw('atMil', '[' + IntToStr(DX) + ',' + IntToStr(DY) + ']') + '}'; End; @@ -9493,7 +9654,11 @@ Var     I, K, N, NWires, NLabels, NPlaced, Col, NCols : Integer;     BandW : Integer;     L0, B0, R0, T0, ColW, ColH, ColX, YCur, SheetW, SheetH, DX, DY, HX, HY, EX, EY, Dir, PW, MaxH : Integer;+    LibPath : String;+    Loaded, HasFp : Boolean;+    NLoaded : Integer; Begin+    NLoaded := 0;     SchPath := Param(Lines, 'sch');     SLib := SchServer.GetCurrentSchDocument;     If (SLib = Nil) Or (SLib.ObjectID <> eSchLib) Then@@ -9651,6 +9816,48 @@ Begin             { snap to the 100 mil grid so pins land on the grid wires snap to }             DX := ((ColX + ColW Div 2 - (L0 + R0) Div 2) Div 100) * 100;             DY := ((YCur - 250 - T0) Div 100) * 100;+            { Altium's own library placement first (#42): every model, the part's own parameters, its identity }+            LibPath := Param(Lines, 'libraryPath');+            If LibPath = '' Then LibPath := SLib.DocumentName;+            Inst := LoadLibComp(LibPath, LibCmp.LibReference);+            Loaded := Inst <> Nil;+            If Loaded Then+            Begin+                NLoaded := NLoaded + 1;+                Sheet.AddSchObject(Inst);+                Inst.CurrentPartID := 1;+                Inst.MoveToXY(MilsToCoord(DX), MilsToCoord(DY));+                { the footprint asked for becomes the current one; one the part lacks is added }+                If Fps[K] <> '' Then+                Begin+                    HasFp := False;+                    PIt := Inst.SchIterator_Create;+                    PIt.AddFilter_ObjectSet(MkSet(eImplementation));+                    Impl := PIt.FirstSchObject;+                    While Impl <> Nil Do+                    Begin+                        If UpperCase(Impl.ModelType) = 'PCBLIB' Then+                        Begin+                            Impl.IsCurrent := UpperCase(Impl.ModelName) = UpperCase(Fps[K]);+                            If Impl.IsCurrent Then HasFp := True;+                        End;+                        Impl := PIt.NextSchObject;+                    End;+                    Inst.SchIterator_Destroy(PIt);+                    If Not HasFp Then+                    Begin+                        Impl := Inst.AddSchImplementation;+                        Impl.ClearAllDatafileLinks;+                        Impl.Description := 'Footprint';+                        Impl.ModelName := Fps[K];+                        Impl.ModelType := 'PCBLIB';+                        Impl.AddDataFileLink(Fps[K], Param(Lines, 'pcblib'), 'PCBLIB');+                        Impl.IsCurrent := True;+                    End;+                End;+            End+            Else+            Begin             Inst := SchServer.SchObjectFactory(eSchComponent, eCreate_Default);             Inst.CurrentPartID := 1;             Inst.DisplayMode := 0;@@ -9676,6 +9883,8 @@ Begin               here, and copying only the drawing left every number column empty (measured 2026-10-15).               Designator and Comment are the instance's own. }             PIt := LibCmp.SchIterator_Create;+            { the part's own parameters only: a deep walk also returns each model's (#42) }+            PIt.SetState_IterationDepth(eIterateFirstLevel);             PIt.AddFilter_ObjectSet(MkSet(eParameter));             Prm := PIt.FirstSchObject;             While Prm <> Nil Do@@ -9702,6 +9911,7 @@ Begin                 Impl.AddDataFileLink(Fps[K], Param(Lines, 'pcblib'), 'PCBLIB');                 Impl.IsCurrent := True;             End;+            End;             Inst.Designator.Text := Refs[K];             Inst.Designator.IsHidden := False;             Inst.Designator.Justification := eJustify_BottomCenter;@@ -9710,7 +9920,7 @@ Begin             Inst.Comment.IsHidden := False;             Inst.Comment.Justification := eJustify_TopCenter;             Inst.Comment.Location := Point(MilsToCoord(DX + (L0 + R0) Div 2), MilsToCoord(DY + B0 - 80));-            Sheet.RegisterSchObjectInContainer(Inst);+            If Not Loaded Then Sheet.RegisterSchObjectInContainer(Inst);             SchServer.RobotManager.SendMessage(Sheet.I_ObjectAddress, c_BroadCast, SCHM_PrimitiveRegistration, Inst.I_ObjectAddress);             NPlaced := NPlaced + 1;             { a wire stub and a net label at every pin's hot spot (Location is the body end) }@@ -9774,7 +9984,8 @@ Begin     SD.DoFileSave('');     Result := '{' + JRaw('ok','true') + ',' + JStr('sch', SchPath) + ',' + JRaw('placed', IntToStr(NPlaced)) + ',' +         JRaw('wires', IntToStr(NWires)) + ',' + JRaw('labels', IntToStr(NLabels)) + ',' + JStr('pinsWithoutNet', NoNet) + ',' +-        JRaw('sheetMil', '[' + IntToStr(SheetW) + ',' + IntToStr(SheetH) + ']') + ',' + JRaw('columns', IntToStr(NCols)) + '}';+        JRaw('sheetMil', '[' + IntToStr(SheetW) + ',' + IntToStr(SheetH) + ']') + ',' + JRaw('columns', IntToStr(NCols)) + ',' ++        JRaw('placedFromLibrary', IntToStr(NLoaded)) + '}';     Ops.Free; Refs.Free; LibRefs.Free; Blocks.Free; Comments.Free; Fps.Free; PinNet.Free; BlockOrder.Free;     BL.Free; BB.Free; BR.Free; BT.Free; ColOf.Free; Cols.Free; End;
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "altium",   "displayName": "Altium Designer",-  "version": "0.2.113",+  "version": "0.2.114",   "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",