skill
kicad10-to-altium
Public Unreviewedby barrett-land
Import KiCad 10 symbols into Altium Designer correctly. Altium 26 supports KiCad through 9 only, so a raw KiCad 10 import silently loses property visibility and every hidden field lands visible. Downgrades v10 to v9 first, then imports headlessly, links the footprint, and repairs visibility.
← Commit history
Publish 1.2.0
5 files changed
+61−6
README.md+11@@ -50,6 +50,17 @@ Altium stores colour as **BGR**, so `8388608` = `$800000` = navy RGB(0,0,128); t The importer also *appends* fonts rather than reusing them, so a library imported into repeatedly accumulates near-duplicate table entries. +**Pins are separate.** Pin name and number are properties of the pin, not parameters, each with its+own font mode — so they keep the imported face even after every parameter is fixed. They are also+**black** in Altium, not navy. `altium_set_text_style` handles both.++## Stacked power pins++KiCad stacks an IC's repeated power pins at one location and hides all but one (three `VSS` pins on+an STM32F103). Altium's importer does not understand `(hide yes)` on a pin — `Unknown child hide of+pin` — so they all arrive visible and their numbers render on top of each other. Hide the same ones+KiCad hid with `altium_set_visibility` + `hidepins`; they stay electrically present regardless.+ ## Derived symbols: the failure a token-perfect conversion still hits KiCad 9 resolves `(extends "Base")` in a **single forward pass**, so a derived symbol placed before
SKILL.md+48−4@@ -164,11 +164,21 @@ adom-desktop --ai-thread "<thread>" altium_set_text_style '{ "schlib": "...\\Libraries\\Symbols\\Resistors.SchLib", "component": "R_10k_0402" }'-# -> {"components":1,"textObjects":11,"fontId":1,"color":8388608,"saved":true}+# -> {"components":1,"textObjects":11,"pins":2,"fontId":1,"color":8388608,"pinColor":0,...} ``` -Defaults are `fontid=1` and `color=8388608`; pass `"component": "*"` to restyle the whole library.-It is idempotent, so running it over already-correct parts is safe.+Defaults are `fontid=1`, `color=8388608` and `pincolor=0`; pass `"component": "*"` to restyle the+whole library. It is idempotent, so running it over already-correct parts is safe.++**Pins need separate handling, and are easy to miss.** Pin name and pin number are *not*+parameters — they are properties of the pin, each with its own font mode (`Name_FontMode`,+`Designator_FontMode`). The importer sets them to **Custom**, pointing at the font it added, so pin+text keeps the imported face even after every parameter is corrected. The verb sets both modes to+`ePinItemMode_Default` (`0`) so they inherit the document default.++Pin **colour** differs from parameter colour: Altium draws pins **black (`0`)**, not the navy used+for parameter text. `Pin.Color` drives the pin line and — in Default mode — its name and number+too, so all three are set, plus the two custom colours in case the mode is later flipped. ⚠️ `fontid=1` is right because Altium seeds a new library's font table with its default face at index 1 — it is **not** guaranteed in a library assembled from elsewhere. Confirm before trusting@@ -182,7 +192,41 @@ for m in re.finditer(r'\|Size(\d+)=(\d+)', txt): print(i, m.group(2), re.search(r'\|FontName%s=([^|]*)' % i, txt).group(1)) ``` -## Step 5 — repair visibility on symbols already imported badly+## Step 5 — un-stack the power pins++KiCad draws an IC's repeated power pins **stacked at one location** with all but one hidden — three+`VSS` pins on an STM32F103, at numbers 23, 35 and 47. Altium's importer does not understand+`(hide yes)` on a pin; the log says only:++```+Warning: Unknown child hide of pin.+```++Every stacked pin therefore arrives **visible**, and their numbers render on top of each other.+That is the "pin numbers piled up" symptom, and it is the same defect as the property-visibility+loss, just applied to pins.++Find them in the source before importing, so you know exactly which to hide:++```python+# group pins by (x, y) -- any group larger than one is stacked+```++Then hide the same ones KiCad hid. They stay electrically present either way:++```bash+adom-desktop --ai-thread "<thread>" altium_set_visibility '{+ "schlib": "...\\STM32_fixed.SchLib",+ "component": "STM32F103C_8-B_Tx",+ "hidepins": "35,47"+}'+# -> {"pinsHidden":2,"shown":0,"hidden":0,...}+```++⚠️ Omit `visible` when you only want to touch pins. It is optional precisely so this call does not+disturb parameter visibility — `shown: 0, hidden: 0` above confirms the parameter pass was skipped.++## Step 6 — repair visibility on symbols already imported badly The verb takes a **whitelist of parameters to show**; everything else is hidden.
__pycache__/kicad_v10_to_v9.cpython-312.pyc⋯ 1 unchanged line ⋯
package.json+1−1@@ -1,6 +1,6 @@ { "slug": "kicad10-to-altium",- "version": "1.1.0",+ "version": "1.2.0", "type": "skill", "description": "Import KiCad 10 symbols into Altium Designer correctly. Altium 26 supports KiCad through 9 only, so a raw KiCad 10 import silently loses property visibility and every hidden field lands visible. Downgrades v10 to v9 first, then imports headlessly, links the footprint, and repairs visibility.", "tags": [
page.json+1−1@@ -1,6 +1,6 @@ { "slug": "kicad10-to-altium",- "version": "1.1.0",+ "version": "1.2.0", "type": "skill", "description": "Import KiCad 10 symbols into Altium Designer correctly. Altium 26 supports KiCad through 9 only, so a raw KiCad 10 import silently loses property visibility and every hidden field lands visible. Downgrades v10 to v9 first, then imports headlessly, links the footprint, and repairs visibility.", "tags": [