Показать сообщение отдельно
Старый 08.11.2019, 15:36   #39
t01849
Пользователь
 
Регистрация: 09.02.2014
Сообщений: 58
Сказал(а) спасибо: 16
Поблагодарили 1 раз в 1 сообщении
Вес репутации: 0
t01849 пока не определено
По умолчанию

Цитата:
Сообщение от Vaseok23 Посмотреть сообщение
подскажите в чем может быть дело

Скрытый текст


FileOptions = 'blum Box.xml';
MakeProperties();
NewBtn = NewButtonInput('APLICA');
NewBtn.OnChange = function() {
Action.Commit();
Action.OnFinish = function() {
Action.Properties.Save(FileOptions);

}
Action.Finish();
}

Action.Properties.Load(FileOptions);
function MakeProperties() {

Prop = Action.Properties;
Tip = Prop.NewCombo('Tip Box', 'TandemBox plus\nTandembox Antaro\nLegrabox')
T = Prop.NewImage('TandemBOX', 'Antaro.png')
L = Prop.NewImage('Legrabox', 'Legrabox.png')
Num = Prop.NewNumber('Numar Sertare',1)
HSertar = Prop.NewCombo('H-Sertar', 'M\nB-C\nF');
Spate = Prop.NewCombo('Tip Spate', 'PAL\nMetal')
Adancime = Prop.NewNumber('Adancime',500);
Material = Prop.NewMaterial('Material');
Cant = Prop.NewButt('Cant');




OkBtn = Prop.NewButton('Executa');
//Обработка нажатия на кнопку Построить
OkBtn.OnClick = function() {

Action.OnFinish = function() {
Action.Properties.Save(FileOptions);
}
Action.Finish();
}
Prop.OnChange = function(){
Make()}

}

SetCamera(p3dFront);
LeftPanel = GetPanel('Укажите левую панель');
RightPanel = GetPanel('Укажите правую панель');
Left = LeftPanel.GabMax.x;
Right = RightPanel.GabMin.x;
Top = GetEdge('Укажите верхнюю границу', AxisX).First.y;
Bottom = GetEdge('Укажите нижнюю границу', AxisX).First.y;

SetCamera(p3dLeft);
Front = GetEdge('Укажите переднюю границу', AxisY).First.z;

Make()
function Make(){
T.Visible = true
L.Visible = true
DeleteNewObjects()
if (Tip.ItemIndex ==1){
NL = 24
LWspt = 87
Lwfund = 75
M = 84
C = 167
D = 199 }
if (Tip.ItemIndex ==0){
NL = 24
LWspt = 87
Lwfund = 75
M = 84
B = 135
D = 199 }
if (Tip.ItemIndex ==2){
NL = 10
LWspt = 38
Lwfund = 35
M = 63
C = 148
F = 212 }

Material.SetActive()
Count = Num.Value;
Thick = ActiveMaterial.Thickness;
function Glisiere(){
if (Tip.ItemIndex == 1){
if (Adancime.Value ==500){
if (HSertar.ItemIndex==1){
GlisieraL = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Tandembox\\Tandembox Antaro C Alb L500, L.fr3d')
GlisieraR = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Tandembox\\Tandembox Antaro C Alb L500, R.fr3d')
}}
if (Adancime.Value ==400){
if (HSertar.ItemIndex==1){
GlisieraL = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Tandembox\\Tandembox Antaro C Alb L400, L.fr3d')
GlisieraR = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Tandembox\\Tandembox Antaro C Alb L400, R.fr3d')
}}}

if (Tip.ItemIndex == 2){
if (Adancime.Value ==500){
if (HSertar.ItemIndex==0){
GlisieraL = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Legrabox\\Legrabox M Orion L500, L.FR3D')
GlisieraR = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Legrabox\\Legrabox M Orion L500, R.FR3D')
}
if (HSertar.ItemIndex==1){
GlisieraL = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Legrabox\\Legrabox C Orion L500, L.FR3D')
GlisieraR = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Legrabox\\Legrabox C Orion L500, R.FR3D')
}
if (HSertar.ItemIndex==2){
GlisieraL = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Legrabox\\Legrabox F Orion L500, L.FR3D')
GlisieraR = OpenFurniture('D:\\Sharing\\Bazis10 Online\\003 Samples\\Blum\\Sertare\\Legrabox\\Legrabox F Orion L500, R.FR3D')
}
} }
GlisieraL.Mount1(LeftPanel, Left, PosY + Thick, Front, 0)

GlisieraR.Mount1(RightPanel, Right - Thick, PosY + Thick, Front, 0)
}
function FaltL16(){
Cut = Fund.AddCut()
Traj= Cut.Trajectory
Traj.AddLine(0, 0, 0, -Adancime.Value+NL)
Cut.Contour.AddRectangle(0, 0, 38, 8)
Cut.Name = 'Falt L ' +'38/'+ 8 + ' pe ' + (Adancime.Value - NL);
}
function FaltR16(){
Cut = Fund.AddCut()
Traj= Cut.Trajectory
Traj.AddLine(Fund.GSize.x, 0, Fund.GSize.x, -Adancime.Value+NL)
Cut.Contour.AddRectangle(0, 0, -38, 8)
//Cut.Contour.AddRectangle(0, 18, 12, 16)
Cut.Name = 'Falt R ' +'38/'+ 8 + ' pe ' + (Adancime.Value - NL);
}
function FaltTL(){
Cut = Fund.AddCut()
Traj= Cut.Trajectory
Traj.AddLine(0, 0, 0, -Adancime.Value+NL)
Paz = Cut.Contour
Paz.AddRectangle(0, 0, 16, 2)

Cut.Name = 'Falt L ' +'16/'+ 2 + ' pe ' + (Adancime.Value - NL);
}
function FaltTR(){
Cut = Fund.AddCut()
Traj= Cut.Trajectory
Traj.AddLine(Fund.GSize.x, 0, Fund.GSize.x, -Adancime.Value+NL)
Paz = Cut.Contour
Paz.AddRectangle(0, 0, -16, 2)

Cut.Name = 'Falt R ' +'16/'+ 2 + ' pe ' + (Adancime.Value - NL);
}


function FaltL18(){
Cut = Fund.AddCut()
Traj= Cut.Trajectory
Traj.AddLine(0, 0, 0, -Adancime.Value+NL)
Paz = Cut.Contour
Paz.AddLine(0, 0, 0, 10)
Paz.AddLine(0, 10, 38, 10)
Paz.AddLine(38, 10, 38, 2)
Paz.AddLine(38, 2, 54, 2)
Paz.AddLine(54, 2, 54, 0)
Paz.AddLine(54, 0, 0, 0)
Cut.Name = 'Falt L ' +'38/'+ 8 + ' pe ' + (Adancime.Value - NL);
}

function FaltR18(){
Cut = Fund.AddCut()
Traj= Cut.Trajectory
Traj.AddLine(0, 0, 0, -Adancime.Value+NL)
Paz = Cut.Contour
Paz.AddLine(Fund.GSize.x, 0, Fund.GSize.x, 10)
Paz.AddLine(Fund.GSize.x, 10, Fund.GSize.x-38, 10)
Paz.AddLine(Fund.GSize.x-38, 10, Fund.GSize.x-38, 2)
Paz.AddLine(Fund.GSize.x-38, 2, Fund.GSize.x-54, 2)
Paz.AddLine(Fund.GSize.x-54, 2, Fund.GSize.x-54, 0)
Paz.AddLine(Fund.GSize.x-54, 0, Fund.GSize.x, 0)
Cut.Name = 'Falt R ' +'38/'+ 8 + ' pe ' + (Adancime.Value - NL);
}

function abs(){
for (var c = 0; c < 4; c++) {
SpateP.AddButt(Cant, c)
Fund.AddButt(Cant, c)}
}

PosY = Bottom;
SectionHeight = Top - Bottom;

if (HSertar.ItemIndex==0) {
Hbox = M
HboxN = 'M'}
if (HSertar.ItemIndex==1) {
if (Tip.ItemIndex ==0){
Hbox = C
HboxN = 'C' }
if (Tip.ItemIndex ==1){
Hbox = C
HboxN = 'Plus B'}
if (Tip.ItemIndex ==2){
Hbox = C
HboxN = 'C'}
}
if (HSertar.ItemIndex==2) {
if (Tip.ItemIndex ==0){
Hbox = D
HboxN = 'D'}
if (Tip.ItemIndex ==1){
Hbox = D
HboxN = 'Plus D'}
if (Tip.ItemIndex ==2){
Hbox = F
HboxN = 'F'}
}
YInc = (SectionHeight - Count * Hbox) / (Count + 1);

for (var k = 0; k < Count; k++) {
PosY += YInc;

Block = BeginParametricBlock()

if (Tip.ItemIndex ==1){
T.Visible = true
L.Visible = false


Block.Name = ('Tandembox ' + HboxN + ' la '+ Adancime.Value )


if (HSertar.ItemIndex ==0) {
Fund = AddHorizPanel(Left + Lwfund/2, Front - Adancime.Value + NL, Right - Lwfund/2, Front, PosY);
Fund.Name = 'Fund Sertar' ;
SpateP = AddFrontPanel(Left + LWspt/2, PosY, Right - LWspt/2, PosY + M, Front - Adancime.Value + NL - Thick);
SpateP.Name = 'Spate Sertar' ;
} ;
if (HSertar.ItemIndex ==1) {
Fund = AddHorizPanel(Left + Lwfund/2, Front - Adancime.Value + NL, Right - Lwfund/2, Front, PosY);
Fund.Name = 'Fund Sertar' ;
SpateP = AddFrontPanel(Left + LWspt/2, PosY, Right - LWspt/2, PosY + C, Front - Adancime.Value + NL - Thick);
SpateP.Name = 'Spate Sertar' ;
};
if (HSertar.ItemIndex ==2) {
Fund = AddHorizPanel(Left + Lwfund/2, Front - Adancime.Value + NL, Right - Lwfund/2, Front, PosY);
Fund.Name = 'Fund Sertar' ;
SpateP = AddFrontPanel(Left + LWspt/2, PosY, Right - LWspt/2, PosY + D, Front - Adancime.Value + NL - Thick);
SpateP.Name = 'Spate Sertar' ;
};
if (Material.Thickness > 16){
FaltTL()
FaltTR() }

};
if (Tip.ItemIndex ==2){
L.Visible = true
T.Visible = false

Block.Name = ('Legrabox ' + HboxN + ' la '+ Adancime.Value )
if(HSertar.ItemIndex ==0) {
Fund = AddHorizPanel(Left + Lwfund/2, Front - Adancime.Value + NL, Right - Lwfund/2, Front, PosY);
Fund.Name = 'Fund Sertar';
SpateP = AddFrontPanel(Left + LWspt/2, PosY + Thick, Right - LWspt/2, PosY + M + Thick, Front - Adancime.Value + NL);
SpateP.Name = 'Spate Sertar';
};
if(HSertar.ItemIndex ==1){
Fund = AddHorizPanel(Left + Lwfund/2, Front - Adancime.Value + NL, Right - Lwfund/2, Front, PosY);
Fund.Name = 'Fund Sertar';
SpateP = AddFrontPanel(Left + LWspt/2, PosY + Thick, Right - LWspt/2, PosY + C + Thick, Front - Adancime.Value + NL);
SpateP.Name = 'Spate Sertar';
};
if(HSertar.ItemIndex ==2){
Fund = AddHorizPanel(Left + Lwfund/2, Front - Adancime.Value + NL, Right - Lwfund/2, Front, PosY);
Fund.Name = 'Fund Sertar';
SpateP = AddFrontPanel(Left + LWspt/2, PosY + Thick, Right - LWspt/2, PosY + F + Thick, Front - Adancime.Value + NL);
SpateP.Name = 'Spate Sertar';
};

if (Material.Thickness < 18){
FaltL16()
FaltR16() }
else{
FaltL18()
FaltR18()
}

}
Glisiere()

abs()
Fund.Build();
SpateP.Build();
PosY += Hbox;
EndParametricBlock()

}

SetCamera(p3dFront);}
Action.Continue()

[свернуть]


Добавлено через 14 минут

Добавлено через 2 минуты

может так ?

Скрытый текст


MakeProperties();

function MakeProperties() {
Prop = Action.Properties;

OkBtn = Prop.NewButton('Расчитать');

OkBtn.OnClick = function() {
alert((weight).toFixed(2) + 'm²');

}
OkBtn = Prop.NewButton('Закончить');

OkBtn.OnClick = function() {
Action.Finish()()

}

var weight = 0;

{
i=0
while (i<10)
{



panel = GetPanel("Alege Panou");
if (panel.AsPanel) {
weight = weight +
((panel.Contour.Width) /1000) *((panel.Contour.Height) /1000 )

} } } }

[свернуть]
Спасибо. Доковыряю дальше. А как сделать чтобы выделение оставалось, если выделяешь несколько панелей?
t01849 вне форума   Ответить с цитированием Вверх