proj_print_all_variants
Export a PDF for every project variant by activating each in turn and restoring the originally active variant afterward.
Instructions
Export a PDF for every project variant.
Loops the project's variants; for each it sets that variant active and
runs the (silent) PDF export, writing one <variant>.pdf per
variant. The originally-active variant is restored at the end. Composes
the existing proj_set_active_variant + proj_export_pdf paths --
no new export machinery.
Args: output_dir: Folder for the per-variant PDFs. Defaults to the workspace directory. project_path: Optional project path. If None, uses the focused project.
Returns:
{"exported": [{variant, output_path, ok, error}], "count"} plus
restored: the variant put back, or null if putting it
back FAILED. Null is not cosmetic. This loop leaves the
project on the last variant it exported, so a null means the
active variant is not the one you started with, and anything
variant-sensitive run afterwards (an export, a BOM,
pcb_apply_dnp_paste_exclusion) will act on the wrong
set. A failure also carries restore_error,
active_variant_unknown and a note.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_dir | No | ||
| project_path | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||