proj_annotate
Annotate schematic designators programmatically without dialogs: compiles the project, sorts unlocked components by chosen order, and assigns sequential R1, R2, C1 prefixes per sheet with undo support.
Instructions
Annotate schematic designators programmatically, no dialog, no user interaction.
Compiles the project, iterates every schematic sheet, collects all unlocked components, sorts them by the chosen order, and assigns sequential designators per alpha prefix (R1, R2, ... C1, C2, ... U1, U2, ...). Designator prefixes are preserved from the current value (e.g., "R?" or "R13" both keep the "R" prefix). Locked designators (Designator.IsLocked = True) are skipped. All changes are wrapped in SchServer.ProcessControl.PreProcess/PostProcess for undo support.
Args: order: Annotation traversal order: "down_then_across" (default: row-major top-to-bottom, left-to-right) "up_then_across" (row-major bottom-to-top, left-to-right) "across_then_down" (column-major left-to-right, top-to-bottom) "across_then_up" (column-major left-to-right, bottom-to-top) "none" (reset all designators to "?")
Returns: Dictionary with: - success: True - order: the order that was applied - renamed: count of components renumbered - reset: count reset to "?" (only for order="none") - skipped_locked: count of locked components left untouched - documents_processed: count of schematic sheets visited - programmatic: True (marks this as the non-interactive path)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | No | down_then_across |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||