!2208 新增:干涉检查功能增加忽略不拆单的板件选项

pull/2212/MERGE
林三 1 year ago committed by ChenX
parent 0d2301dfff
commit 952b41e75d

@ -1,9 +1,9 @@
import { Intent } from '@blueprintjs/core';
import { app } from '../ApplicationServices/Application';
import { ColorMaterial } from '../Common/ColorPalette';
import { DisposeThreeObj } from '../Common/Dispose';
import { CheckInterfereTool } from '../Common/InterfereUtil';
import { Board } from '../DatabaseServices/Entity/Board';
import { ExtrudeSolid } from '../DatabaseServices/Entity/Extrude';
import { HardwareCompositeEntity } from '../DatabaseServices/Hardware/HardwareCompositeEntity';
import { PromptStatus } from '../Editor/PromptResult';
@ -23,16 +23,39 @@ export class Interfere implements Command
if (!this.checkInterfereTool)
this.checkInterfereTool = new CheckInterfereTool(ColorMaterial.GetConceptualMaterial(1));
let enRes = await app.Editor.GetSelection({
Msg: "选择检查干涉的对象",
Filter: {
filterTypes: [HardwareCompositeEntity, ExtrudeSolid, SweepSolid]
}
});
let filterChaiDanBoard = true;
let selectEnts: (HardwareCompositeEntity | ExtrudeSolid | SweepSolid)[] = [];
if (enRes.Status === PromptStatus.Cancel) return;
let selectEnts = enRes.SelectSet.SelectEntityList as (HardwareCompositeEntity | ExtrudeSolid | SweepSolid)[];
while (true)
{
let keyWordList = filterChaiDanBoard ? [{ msg: "不过滤不拆单的板件", key: "N" }] : [{ msg: "过滤不拆单的板件", key: "Y" }];
let enRes = await app.Editor.GetSelection({
Msg: `选择检查干涉的对象${filterChaiDanBoard ? "(过滤不拆单的板件)" : ""}`,
KeyWordList: keyWordList,
Filter: {
filterTypes: [HardwareCompositeEntity, ExtrudeSolid, SweepSolid],
filterFunction: (obj, ent) =>
{
//过滤不拆单的板件
if (filterChaiDanBoard && ent instanceof Board)
return ent.IsChaiDan;
return true;
}
}
});
if (enRes.Status === PromptStatus.OK)
{
selectEnts = enRes.SelectSet.SelectEntityList as (HardwareCompositeEntity | ExtrudeSolid | SweepSolid)[];
break;
}
else if (enRes.Status === PromptStatus.Keyword)
{
if (enRes.StringResult === "Y" || enRes.StringResult === "N")
filterChaiDanBoard = !filterChaiDanBoard;
}
else
return;
}
//进度条
let down = DownPanelStore.GetInstance() as DownPanelStore;

Loading…
Cancel
Save