lib_copy_component
Copy a schematic component within or between libraries, replicating all pins, graphics, and parameters, with optional renaming and overwrite.
Instructions
Copy a component WITHIN or BETWEEN schematic libraries.
Replicates the source component (all pins, graphics, parameters)
and adds it to the destination library. When dest_library is
omitted or equals source_library this behaves as the original
same-library duplicate. When dest_library differs, the
component is copied across libraries -- the source library is
focused for the replicate, then the destination is focused and
the clone is added there. The destination ends focused with the
new component selected. Save is deferred (call app_save_all to
flush).
Args:
source_name: lib_ref of the component to copy.
new_name: lib_ref for the clone. Defaults to source_name
(natural choice for cross-library copies that should
keep their identity).
source_library: .SchLib path to read from. Defaults to the
currently focused document.
dest_library: .SchLib path to write to. Omit (or pass the
same path as source_library) for a same-library
duplicate.
overwrite: When True, a component already named new_name
in the destination is removed first. Default False
returns NAME_EXISTS and changes nothing.
Returns:
Dictionary with success, source, new_name,
source_library, dest_library, same_library and
overwrote flags.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new_name | No | ||
| overwrite | No | ||
| source_name | Yes | ||
| dest_library | No | ||
| source_library | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||