lib_run_across
Run one library command across multiple libraries in a single call to avoid per-library round trips, with results and failures reported separately for each library.
Instructions
Run one library command against several libraries in one call.
Sweeping libraries one at a time costs a round trip and a turn of orchestration per library. This sends the whole sweep as a single request and loops inside Altium.
WHAT THIS DOES NOT SAVE. Opening and saving each library, which is the larger cost and is unavoidable. The saving is the round trips and the waiting between them, which is what makes a twenty library sweep tedious rather than slow.
WHICH ACTIONS WORK. Those that accept a library_path, which is
most of the read and batch-edit commands. The footprint EDITING
commands (create_footprint, add_footprint_pad,
link_3d_model and the rest) act on whichever library is open
and cannot be swept, because focusing the document is the work.
FAILURE IS PER LIBRARY. One library that will not open does not abandon the rest, and the reply reports each library separately rather than as a single flag. "17 of 20 worked" collapses into either a false clean or a false failure the moment it becomes one boolean, and the caller cannot tell which library to fix.
Args:
action: Library command without its namespace, e.g.
"get_components", "batch_rename", "audit_styles".
libraries: Full paths. Passed to Altium separated by "|",
which cannot occur in a Windows path.
params: Parameters shared by every library. Any
library_path here is overridden per library.
timeout: Seconds for the whole sweep, not per library.
Returns:
Dict with results (each: library, success, data, error),
succeeded, failed and libraries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| params | No | ||
| timeout | No | ||
| libraries | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||