diff --git a/src/Add-on/DrawBoard/DrawDrawer.ts b/src/Add-on/DrawBoard/DrawDrawer.ts index 4c061ce3e..4d1d29c6a 100644 --- a/src/Add-on/DrawBoard/DrawDrawer.ts +++ b/src/Add-on/DrawBoard/DrawDrawer.ts @@ -652,6 +652,7 @@ export class DrawDrawrer implements Command if (br.BoundingBox.intersectsBox(handleBox)) { br.RelativeHardware.push(...hardwares); + br.RelativeHandle.push(...hardwares); //这里用新增的拉手去关联,因为不知道旧的是用来干什么的,就不删除了 ens.forEach(e => e instanceof HardwareCompositeEntity && e.RelevanceBoards.push(br.Id)); } } diff --git a/src/Add-on/DrawBoard/ParseHandle.ts b/src/Add-on/DrawBoard/ParseHandle.ts index 16bd1d134..1d81543b6 100644 --- a/src/Add-on/DrawBoard/ParseHandle.ts +++ b/src/Add-on/DrawBoard/ParseHandle.ts @@ -13,7 +13,7 @@ import { PromptStatus } from "../../Editor/PromptResult"; import { ComparePointFnGenerate } from "../../Geometry/GeUtils"; import { AppToaster } from "../../UI/Components/Toaster"; import { FuzzyFactory } from "../../csg/core/FuzzyFactory"; -import { IsDoor } from "../HideSelect/HideSelectUtils"; +import { IsDoor, IsDrawer } from "../HideSelect/HideSelectUtils"; export class ParseHandle implements Command { @@ -21,9 +21,14 @@ export class ParseHandle implements Command { Log("注意:绘制的拉手五金名称必须包含\"拉手\""); let res = await app.Editor.GetSelection({ - Msg: "请选择需要分析拉手的门板:", + Msg: "请选择需要分析拉手的门板(抽屉):", Filter: { - filterFunction: (o, e) => { return e && IsDoor(e); } + filterFunction: (o, e) => + { + const isDoor = e && IsDoor(e); + const isDrawer = e && IsDrawer(e) && (e as Board).RelativeHandle?.length > 0; + return isDoor || isDrawer; + } } }); if (res.Status === PromptStatus.OK) @@ -74,7 +79,7 @@ export class ParseHandle implements Command if (succeedCount) { AppToaster.show({ - message: `成功分析${succeedCount}个门板的拉手位置!(已经写入到板件备注!)`, + message: `成功分析${succeedCount}个门板(抽屉)的拉手位置!(已经写入到板件备注!)`, timeout: 10000, intent: Intent.SUCCESS, }); @@ -83,7 +88,7 @@ export class ParseHandle implements Command if (emptyCount) { AppToaster.show({ - message: `有${emptyCount}个门板没有拉手!`, + message: `有${emptyCount}个门板(抽屉)没有拉手!`, timeout: 10000, intent: Intent.WARNING, }); diff --git a/src/UI/Components/CommandPanel/CommandList.ts b/src/UI/Components/CommandPanel/CommandList.ts index fb8f086af..55dffb5d3 100644 --- a/src/UI/Components/CommandPanel/CommandList.ts +++ b/src/UI/Components/CommandPanel/CommandList.ts @@ -906,7 +906,7 @@ export const CommandList: ICommand[] = [ defaultCustom: CommandNames.ParseHandle, command: CommandNames.ParseHandle, type: "板件编辑", - chName: "将拉手位置写入到门板备注", + chName: "将拉手位置写入到门板(抽屉)备注", chDes: "报表可写出", }, {