Rename object
rename_objectAssign a stable id or label to an SVG object, automatically fixing all cross-references.
Instructions
Change an object's id and/or its inkscape:label.
When to use: giving an object a stable/human id or label. To copy it use duplicate_object; to
keep an id surviving svg_web_optimize add it to that tool's keep_ids.
Key params: provide new_id and/or label (at least one required). Changing the id validates
the new id (safe charset, not already used) and rewrites all in-document references to the old
id so nothing dangles. label is set on inkscape:label.
Return shape: EditResult — operation_id, snapshot_id, changed, before/after preview; the
edit lands on the working copy only (reversible).
Example: rename_object(doc_id, "rect12", new_id="header", label="Header bar")
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 edit on the working copy; original untouched).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | ||
| 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 |