|
|
|
@ -16,6 +16,7 @@ import { ModalPosition, ModalState } from '../UI/Components/Modal/ModalInterface
|
|
|
|
|
import { AppToaster } from '../UI/Components/Toaster';
|
|
|
|
|
import { IBaseOption, IUiOption } from '../UI/Store/BoardInterface';
|
|
|
|
|
import { Hole } from '../DatabaseServices/3DSolid/Hole';
|
|
|
|
|
import { FixedNotZero } from '../Common/Utils';
|
|
|
|
|
|
|
|
|
|
export enum ArrayType
|
|
|
|
|
{
|
|
|
|
@ -109,11 +110,12 @@ export class ArrayStore extends Singleton
|
|
|
|
|
}
|
|
|
|
|
export class Command_Array implements Command
|
|
|
|
|
{
|
|
|
|
|
arrayStore = ArrayStore.GetInstance();
|
|
|
|
|
arrayStore: ArrayStore = ArrayStore.GetInstance();
|
|
|
|
|
|
|
|
|
|
async exec()
|
|
|
|
|
{
|
|
|
|
|
let option = this.arrayStore.m_Option;
|
|
|
|
|
let uiOption = this.arrayStore.UIOption;
|
|
|
|
|
|
|
|
|
|
let ssRes = await app.Editor.GetSelection({
|
|
|
|
|
Msg: "请选择阵列对象:",
|
|
|
|
@ -152,7 +154,9 @@ export class Command_Array implements Command
|
|
|
|
|
{
|
|
|
|
|
let pt1Ucs = ptRes1.Point.applyMatrix4(ucsInv);
|
|
|
|
|
option.x = pt1Ucs.x;
|
|
|
|
|
uiOption.x = FixedNotZero(pt1Ucs.x, 2);
|
|
|
|
|
option.y = pt1Ucs.y;
|
|
|
|
|
uiOption.y = FixedNotZero(pt1Ucs.y, 2);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -165,7 +169,10 @@ export class Command_Array implements Command
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if (disRes1.Status === PromptStatus.OK)
|
|
|
|
|
{
|
|
|
|
|
option.rowOffset = (Math.round(disRes1.Distance * 100) / 100);
|
|
|
|
|
uiOption.rowOffset = FixedNotZero(option.rowOffset, 2);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case Pick.colOffset:
|
|
|
|
@ -177,13 +184,19 @@ export class Command_Array implements Command
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if (disRes2.Status === PromptStatus.OK)
|
|
|
|
|
{
|
|
|
|
|
option.colOffset = (Math.round(disRes2.Distance * 100) / 100);
|
|
|
|
|
uiOption.colOffset = FixedNotZero(option.colOffset, 2);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case Pick.arrayAngle:
|
|
|
|
|
let ptRes4 = await app.Editor.GetAngle({ Msg: "请指定阵列角度:" });
|
|
|
|
|
if (ptRes4.Status === PromptStatus.OK)
|
|
|
|
|
option.arrayAngle = Math.round(ptRes4.Distance);
|
|
|
|
|
{
|
|
|
|
|
option.arrayAngle = ptRes4.Distance;
|
|
|
|
|
uiOption.arrayAngle = FixedNotZero(option.arrayAngle, 6);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case Pick.fillAngle:
|
|
|
|
@ -298,7 +311,9 @@ export class Command_Array implements Command
|
|
|
|
|
{
|
|
|
|
|
updateRect(p1, ptRes.Point);
|
|
|
|
|
option.rowOffset = row;
|
|
|
|
|
uiOption.rowOffset = FixedNotZero(row, 2);
|
|
|
|
|
option.colOffset = col;
|
|
|
|
|
uiOption.colOffset = FixedNotZero(col, 2);
|
|
|
|
|
}
|
|
|
|
|
JigUtils.End();
|
|
|
|
|
break;
|
|
|
|
@ -310,8 +325,11 @@ export class Command_Array implements Command
|
|
|
|
|
break;
|
|
|
|
|
//数据提交
|
|
|
|
|
option.itemTotal = itemTotal;
|
|
|
|
|
uiOption.itemTotal = FixedNotZero(itemTotal, 2);
|
|
|
|
|
option.fillAngle = fillAngle;
|
|
|
|
|
uiOption.fillAngle = FixedNotZero(fillAngle, 2);
|
|
|
|
|
option.betweenAngle = betweenAngle;
|
|
|
|
|
uiOption.betweenAngle = FixedNotZero(betweenAngle, 2);
|
|
|
|
|
//呼出模态框
|
|
|
|
|
app.Editor.ModalManage.RenderModal(ArrayModal, { store: this.arrayStore }, { position: ModalPosition.Old });
|
|
|
|
|
}
|
|
|
|
|