forked from 1b-agent/opencadstudio-upstream
Copying an INSERT and pasting it into another drawing rendered nothing: the clipboard snapshotted referenced layers/linetypes/styles but not the block definition itself, so the pasted reference pointed at a block the target drawing didn't have. Capture every block an copied INSERT references — walking nested INSERTs transitively, skipping model/paper space and xref blocks — and store the definition's base point plus its owned entities. On paste, recreate any of those blocks the target drawing lacks via a new define_block_raw (entities kept in block-local coordinates), before adding the pasted references. Same-document pastes are unaffected since the blocks already exist. Co-Authored-By: Claude Opus 4.8 <[email protected]>