Repository navigation
ppt connector
Connector lines between shapes or standalone lines on slides.
Path: via shape index after creation
- add - Add straight, elbow, or curved connectors
- set - Modify connector properties
- get - Get connector attributes
| Property | Accepted Values | Description |
|---|---|---|
name |
text | Connector name |
x, y
|
EMU or units | Position |
width, height
|
EMU or units | Size |
lineWidth / line.width
|
points | Line width |
lineColor / line.color
|
hex RGB | Line color |
lineDash / line.dash
|
dash style | Line dash style |
lineJoin / linejoin / line.join
|
round, bevel, miter
|
Line join style at corners (accepts compound miter:<lim>) |
miterLimit / miterlimit / miter.limit / line.miterlimit
|
number (1000ths of a percent) | Miter join limit (e.g. 800000 = 800%); implies lineJoin=miter
|
lineOpacity / line.opacity
|
0-1 | Line opacity |
rotation / rotate
|
degrees | Rotation |
preset / prstgeom
|
preset name | Connector preset geometry |
| Key | Type | Description |
|---|---|---|
name |
string | Connector name |
x |
integer | Horizontal position (EMU) |
y |
integer | Vertical position (EMU) |
width |
integer | Width (EMU) |
height |
integer | Height (EMU) |
preset |
string | Connector preset type |
lineWidth |
number | Line width (pt) |
lineDash |
string | Line dash style |
lineJoin |
string | Line join style (round, bevel, miter) |
miterLimit |
number | Miter join limit (1000ths of a percent) |
lineColor |
string | Line color (hex) |
lineOpacity |
number | Line opacity (0-1) |
rotation |
number | Rotation angle (degrees) |
# Set connector color and width
officecli set slides.pptx /slide[1]/shape[2] --prop lineColor=FF0000 --prop lineWidth=3pt
# Get connector properties
officecli get slides.pptx /slide[1]/shape[2]A connector created with from=/to= (or startShape=/endShape=) that references shape IDs or @name= selectors is glued — moving or resizing either endpoint shape automatically updates the connector's coordinates so it stays attached. Watch preview reflects the reroute on the same SSE tick as the move. Align and distribute (set /slide[N] --prop align=... --prop targets=...) reroute attached connectors so they follow moved shapes too.
A connector added with from/to but no explicit x/y/width/height anchors edge-to-edge, not center-to-center — it picks the facing edge pair from the dominant center-to-center axis (|dx|>=|dy| → right/left, else bottom/top) so the drawn line spans the gap between the two shapes instead of running through both boxes. Confirmed live: connecting a box at x=1cm,width=3cm to a box at x=10cm produces a connector at x=4cm, width=6cm (right edge of A to left edge of B), not the old center-to-center span.
| Property | Accepted Values | Description |
|---|---|---|
fromSide / fromside / startSide / startside
|
top, bottom, left, right, center
|
Force which edge of the from shape the line leaves. Omitted = auto-pick the facing edge. center reproduces the legacy center-to-center look. |
toSide / toside / endSide / endside
|
top, bottom, left, right, center
|
Force which edge of the to shape the line enters. Omitted = auto-pick. |
fromIdx / fromidx / startIdx / startidx
|
int (0-based) | Low-level connection-site index on the from shape (a:stCxn idx). Prefer fromSide unless you know the preset's cxnLst ordering. |
toIdx / toidx / endIdx / endidx
|
int (0-based) | Low-level connection-site index on the to shape (a:endCxn idx). Prefer toSide. |
Note: the chosen side only drives the drawn geometry (offset/extent) — the low-level
stCxn/endCxnidx isn't derived from a side yet, so after a manual drag in PowerPoint the connector re-anchors to the auto-picked edge, not the side you forced.
In the browser preview, the connector's stroke is hittable (click / drag to select or drag) while the bounding rectangle stays click-through, so shapes underneath a connector remain selectable normally.
Based on OfficeCLI v1.0.131