diff --git a/src/Add-on/PasteClip.ts b/src/Add-on/PasteClip.ts index 748fa1652..538fbb074 100644 --- a/src/Add-on/PasteClip.ts +++ b/src/Add-on/PasteClip.ts @@ -4,10 +4,10 @@ import { readClipboardText } from "../Common/Utils"; import { CADFile } from "../DatabaseServices/CADFile"; import { Entity } from "../DatabaseServices/Entity"; import { PromptStatus } from "../Editor/PromptResult"; +import { JigUtils } from "../Editor/JigUtils"; export class PasteClip { - async exec() { try @@ -25,8 +25,7 @@ export class PasteClip { let en = f.ReadObject() as Entity; ens.push(en); - - app.m_Database.ModelSpace.Append(en); + JigUtils.Draw(en); } let oldPt = app.m_Editor.m_MouseCtrl.m_CurMousePointWCS; @@ -46,14 +45,14 @@ export class PasteClip } }); - if (ptRes.Status != PromptStatus.OK) - ens.forEach(e => e.Erase()); + if (ptRes.Status === PromptStatus.OK) + for (let e of ens) + app.m_Database.ModelSpace.Append(e); } } catch (error) { app.m_Editor.Prompt("黏贴遇到错误:" + error); } - } }