修复倒角动作的实体被删除时,模块插入失败的问题

CopyGeometryTest
ChenX 5 years ago
parent f79ff76ac8
commit 17f6bc199a

@ -14,7 +14,7 @@ import { TemplateAction } from "./TemplateAction";
export class TemplateFilletAction extends TemplateAction export class TemplateFilletAction extends TemplateAction
{ {
FilletDatas: { Entity: ObjectId, ArcParams: number[] }[] = []; FilletDatas: { Entity: ObjectId, ArcParams: number[]; }[] = [];
constructor() constructor()
{ {
@ -25,7 +25,7 @@ export class TemplateFilletAction extends TemplateAction
{ {
for (let d of this.FilletDatas) for (let d of this.FilletDatas)
{ {
if (d.Entity.IsErase) if (d.Entity?.IsErase)
continue; continue;
let br = d.Entity.Object as Board; let br = d.Entity.Object as Board;
@ -83,9 +83,9 @@ export class TemplateFilletAction extends TemplateAction
let params: number[] = []; let params: number[] = [];
let parCount = file.Read(); let parCount = file.Read();
for (let i = 0; i < parCount; i++) for (let i = 0; i < parCount; i++)
{
params.push(file.Read()); params.push(file.Read());
}
if (id)
this.FilletDatas.push({ Entity: id, ArcParams: params }); this.FilletDatas.push({ Entity: id, ArcParams: params });
} }
} }

Loading…
Cancel
Save