forked from 1b-agent/opencadstudio-upstream
EED names its application by APPID handle. Copying between drawings (paste, COPYTO, block palette insert, REFEDIT) kept the source drawing's handles, so the saved DWG named APPIDs it did not have and the reference program refused to open it (xdata.cpp eInvalidInput). The copy now carries the APPID records its XDATA names, registers the missing ones, and re-points the EED at them. COPYTO also skipped every layer the target lacked (the check tested the source) and filled the target with the whole linetype catalog; it now copies the missing layers and loads only the linetypes used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>