lib_set_label_formats
Batch-apply label styles—font, color, visibility, orientation, and justification—to SchLib designators, comments, or parameters across one component or the whole library in a single pass.
Instructions
Multi-target label-style writer for SchLib symbols.
Applies SEVERAL label target/style ops to SchLib symbols in one IPC round-trip (there is no singular variant). The library is opened once and walked once; every op is applied to each component in turn. Five sequential per-target writes would collapse into one trip plus one library walk -- which is the dominant cost on large libraries (each individual call runs an IPC, a workspace lookup, a doc-focus check and a CompInfoReader walk).
Each op is a dict describing one label target -- no field
has a built-in default, only the ones you supply get written:
{"target": "designator", # required
"font_id": <int>, # optional
"color": <int>, # optional, BGR-packed
"is_hidden": False, # optional
"orientation": <int>, # optional, 0/90/180/270
"justification": <int>} # optionalAt least one style field must be set per op. Targets are
"designator", "comment", or "parameter:<Name>".
Use obj_get_font_id / obj_get_font_spec to resolve the font_id
for {name, size, bold, italic} from the active library's font
table; that keeps the call neutral to any particular library's
style choices.
Args:
ops: List of per-target style ops. Must be non-empty.
Targets may not contain the wire separators ;
or ~~.
component_name: When set, applies only to that one
component. Omit for bulk-walk across the library.
library_path: .SchLib path. Defaults to focused doc.
only_mismatched: When True (default) skip labels
already matching the target style. Applies
globally to every op.
limit: Cap on processed components in bulk mode.
timeout: Per-call bridge poll timeout override.
Returns:
Dict with library_path, scope ("single"|"bulk"),
total, limit, truncated, and an ops array each
with target, modified, already_compliant,
missing_target, failed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | ||
| limit | No | ||
| timeout | No | ||
| library_path | No | ||
| component_name | No | ||
| only_mismatched | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||