forked from 1b-agent/opencadstudio-upstream
feat(automation): undo/redo ops (move/copy already work via select+run)
Add undo and redo ops to the headless server (synchronous via update()).
Combined with select, the modify commands MOVE/COPY work through the
existing dispatcher — "select type=Line" then run("MOVE 0,0 10,0")
translates the selection. ocs.py gains undo()/redo().
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c78bc62056
commit
8d3d0c30cc
3 files changed
+27
No files matched your search
@@ -92,6 +92,14 @@ class Ocs:
|
||||
op="select", handles=handles, type=type, layer=layer, clear=clear
|
||||
)
|
||||
|
||||
def undo(self) -> dict[str, Any]:
|
||||
"""Undo the last change."""
|
||||
return self._send(op="undo")
|
||||
|
||||
def redo(self) -> dict[str, Any]:
|
||||
"""Redo the last undone change."""
|
||||
return self._send(op="redo")
|
||||
|
||||
def save(self, path: Optional[str] = None) -> dict[str, Any]:
|
||||
"""Write the document (defaults to the opened/last-saved path)."""
|
||||
return self._send(op="save", path=path)
|
||||
|
||||
Reference in new issue
Block a user