优化:选择编组失败时,自动修复图纸

pull/1491/MERGE
ChenX 3 years ago
parent 2a6b45556a
commit b587ab5bf9

@ -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;
}

Loading…
Cancel
Save