!1141 修复:排钻错误清除问题

pull/1141/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 64a0753e5d
commit 68c5043e99

@ -3,7 +3,8 @@ import { app } from "../../ApplicationServices/Application";
import { Board } from "../../DatabaseServices/Entity/Board";
import { PromptStatus } from "../../Editor/PromptResult";
import { DrawDrillingTool } from "./DrawDrillingTool";
import { CylinderHole } from "../../DatabaseServices/3DSolid/CylinderHole";
import { CylinderHole, GangDrillType } from "../../DatabaseServices/3DSolid/CylinderHole";
import { Hole } from "../../DatabaseServices/3DSolid/Hole";
enum EDeleteDrillType
{
@ -22,7 +23,7 @@ const keyWordList = [
export class DeleteDrill implements Command
{
private deleteType: EDeleteDrillType = EDeleteDrillType.All;
private deleteType: EDeleteDrillType = EDeleteDrillType.Face;
async exec()
{
while (true)
@ -36,7 +37,7 @@ export class DeleteDrill implements Command
{
case EDeleteDrillType.All:
promptMsg = "<全部删除>选择板件或者排钻进行删除排钻:";
filterTypes = [Board, CylinderHole];
filterTypes = [Board, Hole];
break;
case EDeleteDrillType.Face:
promptMsg = "<板件间排钻删除>选择板件,删除板件间关联的排钻:";
@ -48,7 +49,7 @@ export class DeleteDrill implements Command
break;
case EDeleteDrillType.Drills:
promptMsg = "<删除排钻>选择排钻实体进行删除:";
filterTypes = [CylinderHole];
filterTypes = [Hole];
break;
default:
break;
@ -83,14 +84,15 @@ export class DeleteDrill implements Command
return;
case EDeleteDrillType.Nail:
for (let b of ens as Board[])
{
b.ClearAllDrillList();
b.ClearLayerNails();
}
return;
case EDeleteDrillType.Drills:
for (let e of ens)
{
if (e instanceof CylinderHole && e.Type === GangDrillType.Nail)
continue;
e.Erase();
}
default:
return;
}

@ -19,15 +19,9 @@ export class DrawDrilling implements Command
return;
let ens = brsRes.SelectSet.SelectEntityList as Board[];
let brList: Board[] = [];
for (let e of ens)
{
e.ClearAllDrillList();
brList.push(...e.SplitBoards);
}
const tool = DrawDrillingTool.GetInstance() as DrawDrillingTool;
tool.ClassifyAndDrilling(brList);
tool.ClassifyAndDrilling(ens);
}
}

@ -658,7 +658,7 @@ export class DrawDrillingTool extends Singleton
this.drillEnts.length = 0;
this.woodPins.length = 0;
}
ClassifyBoardList(brList: Board[]): Map<string, Board[]>
private ClassifyBoardList(brList: Board[]): Map<string, Board[]>
{
let brMap: Map<string, Board[]> = new Map();
//根据柜名房名分类
@ -682,9 +682,9 @@ export class DrawDrillingTool extends Singleton
br.ClearDrillList(brs[j].Id);
}
}
StartGangDrill(brs: Board[])
private StartGangDrill(brs: Board[])
{
let checkRes = new CollisionDetection(brs);
let checkRes = new CollisionDetection(this.GetSpliteBoards(brs));
//清理掉已经存在的排钻
this.ClearExitDrilling(brs);
@ -755,4 +755,11 @@ export class DrawDrillingTool extends Singleton
this.StartGangDrill(bs);
}
}
private GetSpliteBoards(brs: Board[])
{
let brList: Board[] = [];
for (let e of brs)
brList.push(...e.SplitBoards);
return brList;
}
}

@ -77,10 +77,7 @@ export class DrillingReactor
if (e instanceof Board)
{
if (!e.IsErase)
{
e.ClearAllDrillList();
brs.push(...e.SplitBoards);
}
brs.push(e);
}
}
this.StartReactor(brs);
@ -90,15 +87,11 @@ export class DrillingReactor
private GetSurroundBoards(brList: Board[])
{
let brs: Board[] = [];
let refBrs: Board[] = [...brList];
for (let b of brList)
if (b.__OriginalEnt__)
refBrs.push(b.__OriginalEnt__);
for (let ent of app.Database.ModelSpace.Entitys)
{
if (ent && !ent.IsErase && ent instanceof Board && !refBrs.includes(ent))
brs.push(...ent.SplitBoards);
if (ent && !ent.IsErase && ent instanceof Board && !brList.includes(ent))
brs.push(ent);
}
let interBrs: Board[] = [];

Loading…
Cancel
Save