!1123 功能:全选(Ctrl+A),命令:SelectAll

pull/1123/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 658f1cb300
commit 99cdc39995

@ -3,6 +3,7 @@ import { Entity } from "../DatabaseServices/Entity/Entity";
import { Light } from "../DatabaseServices/Lights/Light";
import { TemplateRecord } from "../DatabaseServices/Template/TemplateRecord";
import { Command } from "../Editor/CommandMachine";
import { SelectSetBase } from "../Editor/SelectBase";
export class Command_HideSelected implements Command
{
@ -117,3 +118,16 @@ export class Command_SwitchDoor implements Command
}
}
}
export class SelectAll implements Command
{
async exec()
{
let selectData = new SelectSetBase(app.Viewer);
let ens = app.Database.ModelSpace.Entitys.filter(e => e.Id?.Object && e.Visible && !e.IsErase);
for (let br of ens)
selectData._SelectList.add(br.DrawObject);
app.Editor.SelectCtrl.AddSelect(selectData, true);
app.Editor.SelectCtrl.UpdateView();
}
}

@ -240,6 +240,8 @@ export class ApplicationService
}
}
}
else if (e.code === KeyCode.KeyA)
commandMachine.ExecCommand(CommandNames.SelectAll);
app.Editor.UpdateScreen();
}
else if (e.code === KeyCode.F8)

@ -165,4 +165,5 @@ export enum CommandNames
RecyleBin = "RECYCLEBIN",
ChangeColorByMaterial = "CHANGECOLORBYMATERIAL",
RestoreColor = "RESTORECOLOR",
SelectAll = "SELECTALL",
}

@ -97,7 +97,7 @@ import { Command_ExportSTL } from "../Add-on/Exports/ExportSTL";
import { Command_Extend } from "../Add-on/Extends";
import { CommandFillet } from "../Add-on/Fillet";
import { Command_Group, Command_UnGroup } from "../Add-on/Group";
import { Command_HideSelected, Command_HideUnselected, Command_ShowAll, Command_SwitchDoor } from "../Add-on/HideSelected";
import { Command_HideSelected, Command_HideUnselected, Command_ShowAll, Command_SwitchDoor, SelectAll } from "../Add-on/HideSelected";
import { Command_Insert } from "../Add-on/Insert";
import { Command_INsTest } from "../Add-on/instest";
import { Command_Join } from "../Add-on/Join";
@ -517,6 +517,7 @@ export function registerCommand()
commandMachine.RegisterCommand(CommandNames.ChangeColorByMaterial, new ChangeColorByMaterial());
commandMachine.RegisterCommand(CommandNames.SelectAll, new SelectAll());
}
export async function RegistCustomCommand()

@ -285,6 +285,7 @@ input[type=radio] {
flex-direction: column;
flex-wrap: wrap;
margin: 0;
width: 80px;
>li{
width: 40px;
margin: 0;

Loading…
Cancel
Save