From b587ab5bf95c2eb15849c6af806817fae76c6335 Mon Sep 17 00:00:00 2001 From: ChenX Date: Fri, 30 Apr 2021 09:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=E9=80=89=E6=8B=A9=E7=BC=96?= =?UTF-8?q?=E7=BB=84=E5=A4=B1=E8=B4=A5=E6=97=B6,=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=BA=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Editor/SelectBase.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Editor/SelectBase.ts b/src/Editor/SelectBase.ts index 34bc01844..44c458ca6 100644 --- a/src/Editor/SelectBase.ts +++ b/src/Editor/SelectBase.ts @@ -57,12 +57,14 @@ export class SelectSetBase SelectGroup(filter?: Filter): number { let groupCount = 0; + let curEnt: Entity; try { for (let selEnt of this.SelectEntityList) { if (selEnt.GroupId?.Object) { + curEnt = selEnt; let group = selEnt.GroupId.Object as GroupRecord; for (let entId of group.Entitys) { @@ -80,7 +82,11 @@ export class SelectSetBase } catch (error) { - ReportError(error.stack, `命令标识:${commandMachine.LastCmd}`); + //自动修复错误的图纸 + if (curEnt && !(curEnt.GroupId?.Object instanceof GroupRecord)) + curEnt.GroupId = undefined; + + ReportError(error.stack, `选择编组失败`); } return groupCount; }