mirror of https://gitee.com/cf-fz/WebCAD.git
parent
e978094ced
commit
4abdc50424
@ -0,0 +1,29 @@
|
||||
import { app } from "../ApplicationServices/Application";
|
||||
import { arrayRemoveIf } from "../Common/ArrayExt";
|
||||
import { HotCMD } from "../Hot/HotCommand";
|
||||
|
||||
@HotCMD
|
||||
export class Command_Purge
|
||||
{
|
||||
async exec()
|
||||
{
|
||||
let keyRes = await app.Editor.GetKeyWords({
|
||||
Msg: "执行后,历史记录将被清空,是否确认执行?",
|
||||
KeyWordList: [
|
||||
{ key: "Y", msg: "是" },
|
||||
{ key: "N", msg: "否" },
|
||||
],
|
||||
Default: "N"
|
||||
});
|
||||
|
||||
if (keyRes.StringResult !== "Y")
|
||||
return;
|
||||
|
||||
app.Database.hm.Clear();
|
||||
|
||||
arrayRemoveIf(app.Database.ModelSpace.Entitys, e => e.IsErase);
|
||||
arrayRemoveIf(app.Database.TemplateTable.Objects, e => e.IsErase);
|
||||
|
||||
app.Editor.Prompt("清理成功!");
|
||||
}
|
||||
}
|
Loading…
Reference in new issue