Duplicate object
duplicate_objectDuplicate an object or group in place, inserting a self-consistent clone with unique IDs right after the original. Use for copying a single object; for grids or instances use other tools.
Instructions
Duplicate an object or group in place, inserting the clone right after the original.
When to use: copying one object once. To copy into a grid use tile; to instance via <use>
use create_use; to change an id without copying use rename_object.
Key params: the clone re-ids every contained id uniquely and rewrites its internal references so
it is self-consistent. An optional new_id (validated safe and unused) names the clone's top
element; otherwise a suffixed id is generated.
Return shape: EditResult — operation_id, snapshot_id, changed, before/after preview; the
new top id is reported in the summary. Lands on the working copy only (reversible).
Example: duplicate_object(doc_id, "icon", new_id="icon_copy")
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 |
|---|---|---|---|
| doc_id | Yes | ||
| new_id | No | ||
| object_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| changed | Yes | ||
| summary | No | ||
| snapshot_id | Yes | ||
| operation_id | Yes | ||
| preview_after | No | ||
| preview_before | No |