feat(automation): richer query geometry + layers/header introspection

query now emits geometry for Ellipse/Text/MText/Polyline/Insert (on top
of Line/Circle/Arc/Point). Add layers op (name, ACI/RGB colour, on/off,
frozen, locked + current layer) and header op (units, PDMODE/PDSIZE,
LTSCALE, annotation scale, current layer/text style). ocs.py gains
layers()/header(). Lets an agent read the drawing's structure and
settings, not just entity counts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-18 01:50:58 +03:00
1 parent 707c143212
commit d4f5ed3135
3 files changed
+80 -1

No files matched your search

+8
View File
@@ -79,6 +79,14 @@ class Ocs:
"""List entities (handle, type, layer, geometry), optionally filtered."""
return self._send(op="query", type=type, layer=layer, limit=limit)
def layers(self) -> dict[str, Any]:
"""List layers (name, color, on/off, frozen, locked) and the current one."""
return self._send(op="layers")
def header(self) -> dict[str, Any]:
"""Read drawing header variables (units, PDMODE/PDSIZE, LTSCALE, …)."""
return self._send(op="header")
def select(
self,
handles: Optional[list[str]] = None,