fix(task-2): block_explode writes Normal as a VARIANT and keeps constant attributes as TEXT
COM: ``text.Normal`` was a plain Python tuple, which ActiveX marshals as VT_ARRAY|VT_VARIANT and refuses with E_INVALIDARG (verified live on AutoCAD 2026); because the write came after Explode(), the ATTDEF deletes and AddText, the tool raised and left the drawing torn. It now goes through ``_apoint`` like every other point write, and the fake ActiveX surface refuses a bare tuple on Normal/InsertionPoint/TextAlignmentPoint so a test cannot pin the wrong call shape again. COM: every AcDbAttributeDefinition Explode() returned was deleted, but GetAttributes() excludes constant attributes, so a constant attribute's only visible text was destroyed with ok: True. A constant ATTDEF from the explode (Constant member, or its tag in GetConstantAttributes()) is now captured like an ATTRIB and replaced by a TEXT; placeholders are still just deleted. ezdxf: an AutoCAD-authored reference carries no ATTRIB for a constant attribute and virtual_entities() skips ATTDEF, so the same text vanished headlessly. A constant ATTDEF whose tag has no attached ATTRIB becomes a TEXT transformed by the reference matrix, the path add_auto_attribs takes, and is not converted twice when block_insert did attach one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
co-authored by
Claude Opus 5
parent
415de73137
commit
b12fa854c1
@@ -3031,8 +3031,9 @@ async def block_explode(
|
||||
|
||||
Every attached ATTRIB becomes a TEXT with the same value, placement,
|
||||
height, rotation and layer (an invisible attribute becomes an invisible
|
||||
TEXT); AutoCAD's plain EXPLODE would keep only the tag-name placeholders
|
||||
and drop the values. Everything lands in the layout that owns the
|
||||
TEXT), and a constant attribute (which has no ATTRIB) becomes a TEXT of
|
||||
its value too; AutoCAD's plain EXPLODE would keep only the tag-name
|
||||
placeholders and drop the values. Everything lands in the layout that owns the
|
||||
reference (model space or its paper-space sheet), whichever tab is
|
||||
current. Returns `inserted_handles` (the geometry), `attribute_texts`
|
||||
(one TEXT handle per attribute), `exploded_handle` and `backend`.
|
||||
|
||||
Reference in New Issue
Block a user