!1137 修复:虚拟空间绘制酒格板厚无效问题

pull/1137/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent d96588e096
commit d3c6972bef

@ -31,13 +31,6 @@ export class TemplateWineRackRecord extends TemplateRecord
Object.assign(this.option, option);
ExtendsBoardThickness(this, option.boardThick);
}
// InitBaseParams()
// {
// super.InitBaseParams();
// return this;
// }
protected async Update()
{
await super.Update();

@ -1068,22 +1068,23 @@ export function RemoveTemplate(temp: TemplateRecord)
let replaceJig = new Jig();
/**新模块替换旧模块 */
export async function ReplaceTemplate(oldTemp: TemplateRecord, newTemp: TemplateRecord, reSelectSpace = true)
/**新模块替换旧模块 ,extendExpr-是否继承旧模板表达式*/
export async function ReplaceTemplate(oldTemp: TemplateRecord, newTemp: TemplateRecord, reSelectSpace = true, extendExpr = true)
{
//拷贝所有共有参数
for (let index = 0; index < oldTemp.Params.length; index++)
{
let oldParam = oldTemp.Params[index];
//https://gitee.com/BearCAD/WebCAD/pulls/1048#note_2620830
let newExpr = oldParam.expr;
if (index < 9)
if (extendExpr) //#I1MFG0,替换虚拟空间时不继承表达式
for (let index = 0; index < oldTemp.Params.length; index++)
{
newTemp.Params[index].expr = newExpr;
continue;
let oldParam = oldTemp.Params[index];
//https://gitee.com/BearCAD/WebCAD/pulls/1048#note_2620830
let newExpr = oldParam.expr;
if (index < 9)
{
newTemp.Params[index].expr = newExpr;
continue;
}
newTemp.SetParamExpr(oldParam.name, newExpr);
}
newTemp.SetParamExpr(oldParam.name, newExpr);
}
let positioning = oldTemp.Positioning;
// if (!(positioning instanceof PositioningTemporary && oldTemp.Parent && !oldTemp.Parent.IsErase))
@ -1196,7 +1197,7 @@ export async function SetTemplatePositionAndSetParent(spaceParse: ISpaceParse, t
else if (spaceParse.VisualSpaceBox)
{
let vstemplate = spaceParse.VisualSpaceBox.Template.Object as TemplateVisualSpace;
ReplaceTemplate(vstemplate, template);
ReplaceTemplate(vstemplate, template, true, false);
DeleteTempate(vstemplate);
}
else

@ -271,12 +271,16 @@ export class BoardMoveTool
let p1 = app.Viewer.PreViewer.WorldToViewPoint(pts[0].clone()).setZ(0);
let p2 = app.Viewer.PreViewer.WorldToViewPoint(pts[1].clone()).setZ(0);
let oldAutoUpdate = dim.AutoUpdate;
dim.AutoUpdate = false;
dim.FootP1 = p1;
dim.ArmP1 = p1;
dim.FootP2 = p2;
dim.ArmP2 = p2;
dim.TextRotation = 0;
dim.TextString = FixedNotZero(pts[0].distanceTo(pts[1]), 2);
dim.AutoUpdate = oldAutoUpdate;
dim.DeferUpdate();
}
}
}

@ -283,7 +283,8 @@ export class TempalteActionDialog extends React.Component<ITempalteActionDialogP
{
const template = this.props.store.Template;
let par = template.GetParam(parName);
par.actions.push(act);
if (par)
par.actions.push(act);
};
private addTemplateParam = () =>
{

@ -244,15 +244,19 @@ export default class TempalteActionList extends React.Component<ITempalteActionL
}
targetNodes.splice(lastIndex, 1);
let parName = node.nodeData["name"];
let tempPar = template.GetParam(parName);
if (this._currentNodePath.length === 2)
{
template.GetParam(parName).actions.splice(lastIndex, 1);
if (tempPar)
tempPar.actions.splice(lastIndex, 1);
if (targetNodes.length === 0)
nodes.splice(this._currentNodePath[0], 1);
}
else
{
template.GetParam(parName).actions.length = 0;
if (tempPar)
tempPar.actions.length = 0;
}
this._currentNodePath = undefined;

Loading…
Cancel
Save