create_derived_symbol
Make a new symbol that extends a symbol of the same project library, as "Derive from existing symbol" of the symbol editor of KiCad 10 does.
Instructions
Make a new symbol that extends a symbol of the same project library, as "Derive from existing symbol" of the symbol editor of KiCad 10 does.
The new symbol has the units, the pins and the drawings of its parent (extends). Its mandatory fields are copies of the fields of the parent: the Footprint and the Datasheet are empty unless keep_footprint and keep_datasheet; the Value of a power symbol is the new name. With transfer_user_fields, the new symbol gets a copy of each user field of the parent (MPN, for example), with an empty text unless keep_user_field_content. The arguments have the defaults of the dialog of KiCad (the check boxes are off). KiCad 10.0 saves the keywords and the footprint filters of the parent into the new symbol (LIB_SYMBOL::GetKeyWords). Set the Value, the MPN and the other fields after this with set_library_symbol_properties.
The parent must be in a library of the project table, in the version of the installed KiCad: for a symbol of a global library, copy it first with copy_symbol_to_library. As the dialog, the tool writes the escapes of the name ("{colon}" for ":") and a space as "_". A name that the library has already is an error: the tool does not replace a symbol. KiCad saves the library (kicad-cli), and a second save must give the same bytes. KiCad must not have the project open. The installed KiCad must be KiCad 10.0.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_path": "<project_path>",
"parent_lib_id": "<parent_lib_id>",
"name": "<name>"
},
"name": "create_derived_symbol"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the new symbol. | |
| project_path | Yes | The .kicad_pro file or the project folder. | |
| parent_lib_id | Yes | The parent, "<library>:<symbol>", of a library of the project table. The new symbol goes into the same library. | |
| keep_datasheet | No | Keep the Datasheet of the parent ("Keep linked datasheet"). | |
| keep_footprint | No | Keep the Footprint of the parent ("Keep linked footprint"). | |
| transfer_user_fields | No | Copy the user fields of the parent ("Transfer user-defined fields"). | |
| keep_user_field_content | No | With transfer_user_fields, keep their texts ("Keep content of user-defined fields"). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |