Create line
create_lineCreates a straight line segment from specified coordinates. Optionally sets stroke color and width for painting the line.
Instructions
Create a <line> from (x1, y1) to (x2, y2).
When to use: a single straight segment. For a multi-segment open run use create_polyline; for
a closed shape use create_polygon.
Key params: endpoints (x1, y1) / (x2, y2); inserted into parent_id (must exist) or the
document default parent; object_id to pin the id. Optional stroke / stroke_width
paint the segment in this call (a line is unfilled by nature, so no fill; validated like
set_stroke; default None = unpainted).
Return shape: CreateResult — object_id (new id), analytic bbox (the segment's axis-aligned
extent), plus the pipeline fields (operation_id, snapshot_id, changed, preview).
Example: create_line(doc_id, 0, 0, 100, 100, stroke="black", stroke_width="2")
Render and look before you trust this edit: render with render_preview (or live_render_view)
and inspect the result before relying on it; restore_snapshot reverts it if it is wrong.
Risk class: medium (reversible write-new on the working copy; original untouched).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x1 | Yes | ||
| x2 | Yes | ||
| y1 | Yes | ||
| y2 | Yes | ||
| doc_id | Yes | ||
| stroke | No | ||
| object_id | No | ||
| parent_id | No | ||
| stroke_width | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bbox | No | ||
| doc_id | Yes | ||
| changed | Yes | ||
| summary | No | ||
| object_id | Yes | ||
| snapshot_id | Yes | ||
| operation_id | Yes | ||
| preview_after | No | ||
| preview_before | No |