Цитата:
|
Цитата:
|
Цитата:
|
Цитата:
2. По коду не нашёл ничего похожего на настройку "со стрелками или без", не знаю, есть ли вообще возможность убрать стрелки у размера. |
Всем привет. Может кто знает, как скриптом выделить несколько панелей(может и больше) и подсчитать их площадь. Пробовал через for, не получается. Спасибо.
|
Цитата:
PHP код:
2. Подсчёт площади - серьёзная вещь. Простой способ - перемножить ширину на длину, например Выдать площадь выделенной панели в метрах квадратныхPHP код:
[свернуть] Способ сложнее - считать площадь по элементам контура. Этого пока вроде никто не делал. |
после запуска скрипта - форма(не модальная) с кнопкой "вычислить"(это сам сделаю), выделяю панели(какие необходимы для просчёта), нажимаю кнопку, алерт - площадь...(тоже сам). Не получается у меня что то.
Добавлено через 2 минуты Цитата:
|
в 10-тке работал, в 11 выдает кучу ошибок
подскажите в чем может быть дело
Скрытый текст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 ) } } } } [свернуть] |
Цитата:
|
Цитата:
if (Tip.ItemIndex == 0){ в котором назначается GlisieraL и GlisieraR |
Текущее время: 20:28. Часовой пояс GMT +3. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© 2007-2023 PROMEBEL