From 15cd59ef31e8105421964003e59a5f8e3777cc68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=AF=97=E6=B4=A5?= <2723065175@qq.com> Date: Tue, 8 Aug 2023 02:14:33 +0000 Subject: [PATCH] =?UTF-8?q?!2347=20=E5=8A=9F=E8=83=BD:=E6=8A=BD=E5=B1=89?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=A7=A3=E6=9E=90=E6=8B=89=E6=89=8B=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/DrawBoard/DrawDrawer.ts | 1 + src/Add-on/DrawBoard/ParseHandle.ts | 15 ++++++++++----- src/UI/Components/CommandPanel/CommandList.ts | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) 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: "报表可写出", }, {