lib_export_kicad_symbol
Exports a SchLib symbol to a KiCad 6+ .kicad_sym file, converting pins, electrical types, and mils-to-mm coordinates into an S-expression symbol.
Instructions
Export a SchLib symbol to a KiCad .kicad_sym file.
Reads the symbol's pins from the active schematic library and writes a KiCad 6+ S-expression symbol: a body rectangle sized to the pin roots plus one pin per Altium pin (designator -> number, name, electrical type, position, orientation). Coordinates convert mils -> mm. This covers the symbol only; footprint export is separate.
Naming a component SELECTS it in the library, and that outlives
the call: exporting is a read, but it leaves the library on the
component it exported. Tools called afterwards without a
component name act on whatever is current, so a following
lib_add_pins would add pins here. The reply reports it in
current_component when a name was given.
Args: component_name: LibRef to export. If empty, exports whatever component is currently selected in the SchLib. output_path: Destination .kicad_sym file. Defaults to workspace/.kicad_sym. reference: Reference designator prefix for the symbol (default "U").
Returns: {"output_path", "symbol", "pin_count"} or an error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reference | No | U | |
| output_path | No | ||
| component_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||