sch_mirror_component
Mirror a placed schematic component horizontally by reflecting its primitives and setting the IsMirrored flag, so the part actually flips on the canvas and survives library updates.
Instructions
Mirror a placed schematic component horizontally.
USE THIS RATHER THAN WRITING IsMirrored. Setting that property
with obj_modify does not mirror anything: measured on AD26, the
flag is set, it reads back, Altium's own Properties panel shows
Mirrored ticked, and the part does not move. The canvas draws
from the component's primitives, so a flag-only write leaves
nothing new to draw and no redraw call can rescue it.
Altium's own mirror does both halves at once, setting the flag AND reflecting the primitives, and so does this. That matters twice over: a part mirrored here is identical on disk to one mirrored by hand, and the flag is instance data, so the result survives Update From Libraries. Reflecting the primitives alone would be undone the next time anyone re-instantiates the symbol.
Args: designator: component to mirror, e.g. "U1" mirrored: True or False for an absolute state; omit to toggle. Asking for the state it already has is a no-op, not a second reflection. doc_path: sheet to act on. Defaults to the focused schematic.
Every primitive is reflected about the component's X: pins (left and right swap), lines and rectangles by both ends, polygons, polylines and Beziers by every vertex, and arcs by their centre with their sweep mirrored. A primitive kind it cannot reflect is left where it was and counted in primitives_skipped.
Returns: Dictionary with designator, mirrored (the resulting state), primitives_moved, primitives_skipped, and changed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_path | No | ||
| mirrored | No | ||
| designator | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||