fix(blocks): block_define refuses a non-finite base point and a missing layer unless create_layers
base_x/base_y were only float()-cast, so a NaN base point was written into the BLOCK record; a primitive on a layer the drawing lacks was written as a dangling reference doc.audit() never flags (and on COM would fail mid-loop after Blocks.Add). validate_base_point names the key; the layer table is probed before the first write and the missing names are refused, or created and reported as layers_created when create_layers=true (new optional kwarg, contract + both engines + tool). 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
7f79497928
commit
375c9f4c70
@@ -34,6 +34,7 @@ async def test_defines_geometry_and_attdefs(backend):
|
||||
"entity_count": 7,
|
||||
"attdef_count": 2,
|
||||
"replaced": False,
|
||||
"layers_created": [],
|
||||
"backend": "ezdxf",
|
||||
}
|
||||
blk = backend._doc.blocks.get("PID_VALVE_TEST")
|
||||
|
||||
Reference in New Issue
Block a user