lib_clear_source_library
Unpin SchLib symbols from stale source-library provenance by clearing SourceLibraryName, resetting TargetFileName, and syncing DesignItemId, so placements stop relinking to missing libraries.
Instructions
Unpin a SchLib's symbols from their source-library provenance.
Library-side sibling of sch_clear_source_library. Symbols
copied in from another library (a vendor pack, a stock library
like the built-in miscellaneous-devices set) carry three
provenance fields pointing at their ORIGIN: SourceLibraryName,
TargetFileName, and DesignItemId. Left stale, every placement
from your library re-links against a library that no longer
exists on the machine and lands in the state.
Per matching component: clears SourceLibraryName, resets TargetFileName to '*', and syncs DesignItemId to the LibReference (each independently switchable). This is the minimal fast path of what lib_normalize_implementations does inside its full model sweep, when you only need the provenance cleaned, use this. Deferred save: flush with app_save_all.
Args: library_path: absolute .SchLib path; empty = focused library. component_names: restrict to these LibReferences; None/empty = every component in the library. clear_target_file_name: reset TargetFileName to '*'. sync_design_item_id: set DesignItemId = LibReference where they differ.
Returns: {"library_path": ..., "total": inspected, "cleared_source_library": n, "cleared_target_file_name": n, "synced_design_item_id": n}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| library_path | No | ||
| component_names | No | ||
| sync_design_item_id | No | ||
| clear_target_file_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||