使用Jig优化Ctrl+V

pull/192/head
ChenX 6 years ago
parent 05501ce44b
commit d7757c15c1

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

Loading…
Cancel
Save