!2999 修复:铰链替换铰链或把手时,部分情况下型号属性被修改

pull/3004/head
林三 1 month ago committed by ChenX
parent 5a56028abf
commit 885d208846

@ -2,7 +2,7 @@ import { Intent } from "@blueprintjs/core";
import { Box3, Matrix4, Vector3 } from "three";
import { ExtendsbrThick2 } from "../../Add-on/DrawBoard/BuildBoardTool";
import { FaceDirection } from "../../Add-on/DrawDrilling/DrillType";
import { IsHinge } from "../../Add-on/HideSelect/HideSelectUtils";
import { IsHandle, IsHinge } from "../../Add-on/HideSelect/HideSelectUtils";
import { app } from "../../ApplicationServices/Application";
import { arrayRemoveOnce } from "../../Common/ArrayExt";
import { CommandNames } from "../../Common/CommandNames";
@ -1441,7 +1441,7 @@ export async function ReplaceTemplate(oldTemp: TemplateRecord, newTemp: Template
GetEntityInfo(en, oldTemp, entInfo); //获取被替换实体信息
//替换对象不是有效对象时(可视化模块空间),不继承该对象属性
if (entInfo.followAttribute)
followAttribute(entInfo, newTemp); //房名、柜名、板名跟随
followAttribute(entInfo, newTemp, IsHinge(en) || IsHandle(en)); //房名、柜名、板名跟随
}
if (oldTemp?.Parent?.Object)//如果有父对象,则重新设置成它的儿子

@ -1413,8 +1413,9 @@ export class TemplateManage extends React.Component<ITemplateManage, {}>
* openDir
* @param {IGetRoomInfo} entInfo
* @param {TemplateRecord} newTemp
* @param {boolean} isHingeOrHandle IsDoor() , name.includes("门")
*/
export function followAttribute(entInfo: IGetRoomInfo, newTemp: TemplateRecord)
export function followAttribute(entInfo: IGetRoomInfo, newTemp: TemplateRecord, isHingeOrHandle = false)
{
for (let ent of newTemp.AllEntitys)
{
@ -1449,7 +1450,7 @@ export function followAttribute(entInfo: IGetRoomInfo, newTemp: TemplateRecord)
else if (ent instanceof HardwareCompositeEntity)
{
ent.WriteAllObjectRecord();
if (IsDoor(ent) || ent.HardwareOption.name.includes("门")) //针对门板类型赋值开门方向
if (IsDoor(ent) || (!isHingeOrHandle && ent.HardwareOption.name.includes("门"))) //针对门板类型赋值开门方向
{
ent.HardwareOption.model = (typeof entInfo.openDir === "string") ? entInfo.openDir : GetHardwareOpenDir(entInfo.openDir);
//继承备注信息

Loading…
Cancel
Save