fix(task-23): user_select reports the picked point in WCS — GetEntity answers in the current UCS, so translate acUCS→acWorld before returning

Measured on AutoCAD 2026: under a UCS at (100,50) rotated 90 deg, a pick on a
circle at WCS (105,70) came back from IAcadUtility.GetEntity as (20,-5,0),
while Utility.GetPoint already answered in WCS. A model doing ucs_set ->
user_select -> entity_create_* at `picked` would place geometry at a silently
wrong position. The point goes through Utility.TranslateCoordinates(acUCS,
acWorld) packed as a VT_ARRAY|VT_R8 VARIANT (the plain tuple GetEntity hands
back is refused as "Invalid argument Point"). The fake Utility now models the
UCS frame and the VARIANT requirement; a new test pins the measured figures
and checks GetPoint stays untranslated. Docstrings state WCS.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
Umut CAN
2026-09-21 21:34:26 +03:00
co-authored by Claude Opus 5
parent b83a74e969
commit 2052915f34
4 changed files with 95 additions and 5 deletions
+3 -1
View File
@@ -7240,7 +7240,9 @@ async def user_select(
ctx: Context = None,
) -> dict:
"""Returns `handles` the operator picked — one with `mode="single"` (plus
the `picked` point), any number with `mode="multiple"` (Enter with nothing
the `picked` point `[x, y]` in **WCS** — AutoCAD reports it in the current
UCS and the tool translates, so a UCS made current by `ucs_set` never
shifts it), any number with `mode="multiple"` (Enter with nothing
selected is `count: 0`, not a cancel). ESC → `cancelled: true`; a wait
longer than `COM_CALL_TIMEOUT` → `timed_out: true`. Refusals: a mode
outside the two, an empty prompt; headless, `capability: