命令:翻转纹路FZWL

pull/1446/head
ChenX 4 years ago
parent b19f5ca43b
commit 2b966de4eb

@ -0,0 +1,32 @@
//翻转纹路
import { app } from "../ApplicationServices/Application";
import { EBoardKeyList } from "../Common/BoardKeyList";
import { Board } from "../DatabaseServices/Entity/Board";
import { Command } from "../Editor/CommandMachine";
import { PromptStatus } from "../Editor/PromptResult";
import { LinesType } from "../UI/Store/BoardInterface";
export class Command_FZWL implements Command
{
async exec()
{
let brsRes = await app.Editor.GetSelection({
UseSelect: true,
Msg: "选择需要反转排钻面的板件",
Filter: { filterTypes: [Board] }
});
if (brsRes.Status === PromptStatus.Cancel) return;
let brs = brsRes.SelectSet.SelectEntityList as Board[];
for (let br of brs)
{
if (br.BoardProcessOption[EBoardKeyList.Lines] === LinesType.Reverse)
br.BoardProcessOption[EBoardKeyList.Lines] = LinesType.Positive;
else if (br.BoardProcessOption[EBoardKeyList.Lines] === LinesType.Positive)
br.BoardProcessOption[EBoardKeyList.Lines] = LinesType.Reverse;
}
}
}

@ -116,6 +116,7 @@ import { Command_Extend } from "../Add-on/Extends";
import { Command_OpenHistory } from "../Add-on/File/OpenHistory";
import { CommandFillet } from "../Add-on/Fillet";
import { Command_FindBoardModelingKnife } from "../Add-on/FindBoardModelingKnife";
import { Command_FZWL } from "../Add-on/FZWL";
import { Command_Group, Command_UnGroup } from "../Add-on/Group";
import { Command_HideSelected, Command_HideUnselected, Command_ShowAll, Command_SwitchDoor, SelectAll, ShowHideSelectPanel } from "../Add-on/HideSelected";
import { Command_Insert } from "../Add-on/Insert";
@ -190,6 +191,7 @@ import { Command_ToggleUI } from "../Add-on/ToggleUI";
import { Command_Trim } from "../Add-on/Trim";
import { Command_Curve2Polyline } from "../Add-on/twoD2threeD/Command_Curve2Polyline";
import { Command_Curve2VSBox } from "../Add-on/twoD2threeD/Command_Curve2VSBox";
import { Command_ParseBoardName } from "../Add-on/twoD2threeD/ParseBoardName";
import { Polyline2Board } from "../Add-on/twoD2threeD/Polyline2Board";
import { Rect2Board } from "../Add-on/twoD2threeD/Rect2Board";
import { Redo, Undo } from "../Add-on/Undo";
@ -219,7 +221,6 @@ import { BuyMaterial } from './../Add-on/BuyMaterial';
import { Interfere } from './../Add-on/interfere';
import { ShowKinfeManageModal } from './../Add-on/showModal/ShowKnifeManageModal';
import { commandMachine } from './CommandMachine';
import { Command_ParseBoardName } from "../Add-on/twoD2threeD/ParseBoardName";
export function registerCommand()
{
@ -407,6 +408,7 @@ export function registerCommand()
commandMachine.RegisterCommand(CommandNames.Drawer, new DrawDrawrer());
commandMachine.RegisterCommand(CommandNames.DeleteHole, new DeleteDrill());
commandMachine.RegisterCommand(CommandNames.ReverseDrillFace, new ReverseDrillFace());
commandMachine.RegisterCommand("FZWL", new Command_FZWL());
commandMachine.RegisterCommand("editorboardTemplate", new EditorBoardTemplate());
commandMachine.RegisterCommand(CommandNames.ActicityLayerBoard, new ActicityLayerBoard());

Loading…
Cancel
Save