!2176 修复:铰链模板含有除复合以外实体,解析铰链信息错误问题

Merge pull request !2176 from 林三/parse_hinge_fix
pull/2256/head
林三 1 year ago committed by ChenX
parent 1cf02a3b0f
commit 4bdfaa8558

@ -23,7 +23,7 @@ export class ParseHinge implements Command
let res = await app.Editor.GetSelection({ let res = await app.Editor.GetSelection({
Msg: "请选择需要分析铰链的门板:", Msg: "请选择需要分析铰链的门板:",
Filter: { Filter: {
filterFunction: (o, e) => IsDoor(e) filterFunction: (o, e) => { return e && IsDoor(e); }
} }
}); });
if (res.Status === PromptStatus.OK) if (res.Status === PromptStatus.OK)
@ -149,8 +149,8 @@ function ParseHingeToDoor(door: Entity, hingObjId: ObjectId<CADObject>[], hingeM
for (let hid of hingObjId) for (let hid of hingObjId)
{ {
let hw = hid?.Object as HardwareCompositeEntity; let hw = hid?.Object;
if (!hw || hw.IsErase) if (!hw || hw.IsErase || !(hw instanceof HardwareCompositeEntity)) //过滤掉铰链模板其他类型实体
continue; continue;
if (hw.HardwareOption.name.includes("铰链")) if (hw.HardwareOption.name.includes("铰链"))

Loading…
Cancel
Save