From e485c533addba214dc8cdee5fbdec0a07747f3b3 Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 20 Oct 2021 08:24:07 +0200 Subject: [PATCH] DataBeam : - nei LongCut lavorati con fresa di fianco corretto calcolo sicurezza aggiuntiva per inclinazione fresa rispetto alla trave - nei LapJoint corretta gestione inversione direzione utensile con Tunnel - nei LapJoint ora OpenPocket anche se diviso in parti ma con 1 o 2 facce - nei LapJoint nel caso Lamello (SideMillAsBlade) introdotta lunghezza minima. --- LuaLibs/ProcessLapJoint.lua | 22 ++++++++------ LuaLibs/ProcessLongCut.lua | 60 +++++++++++++++++++++++-------------- 2 files changed, 51 insertions(+), 31 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 478edc6..c326265 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -26,6 +26,7 @@ -- 2021/09/23 Gestione migliorata lavorazioni BH (blockhaus) su macchina fast BH, -- migliorata applicazione lavorazioni BH su feature lunghe lavorte a passi -- 2021/10/06 Ad antischeggia con lama in presenza di testa da sotto aggiunta preferenza a testa da sopra. +-- 2021/10/19 Corretta gestione inversione per Tunnel. OpenPocket anche se spezzato ma 1 o 2 facce. Introdotta lunghezza minima per lamello. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -2741,6 +2742,7 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end for i = 1, nStep do local dOffs = ( i - 1) * dStep + if vtN:getZ() < BD.NZ_MINA then dOffs = dOffs + dSawThick end local bOk, sErr, nMchId = BL.MakeOneFaceBySaw( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw) if not bOk then return bOk, sErr end -- setto l'elevazione @@ -3632,7 +3634,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) bInvertMach = true -- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti - elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL then + elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) bInvertMach = true end @@ -4324,7 +4326,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa for i = 1, Proc.Fct do local nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL -- elimino una faccia - nBottomFace = i-1 + nBottomFace = i - 1 if EgtSurfTmRemoveFacet( nNewProc, nBottomFace) then -- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( nNewProc, nPartId) @@ -4738,7 +4740,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- settaggio voluto da Alessandro/Fabio (per fare angoli con fresa piccola) sMchFind = 'Pocket' local dDiam = min( dH, dV) - if bSinglePart and (( Proc.Fct == 1) or ( Proc.Fct == 2 and bIsL) or ( Proc.Fct == 3 and bIsU) or Proc.Fct == 4) then + if ( Proc.Fct == 1) or ( Proc.Fct == 2 and bIsL) or ((( Proc.Fct == 3 and bIsU) or Proc.Fct == 4) and bSinglePart) then sMchFind = 'OpenPocket' if bIsU then dDiam = GetUShapeWidth( Proc, nFacInd) or dDiam @@ -4820,7 +4822,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local dMaxDepthOnSide = 0 if ( Proc.Prc == 16 or Proc.Prc == 30 or Proc.Prc == 32 or Proc.Prc == 39) then -- verifico se ho una gola con 3 facce ed eventualmente delle facce terminali: - -- faccio una copia della superfice e elimino le facce che hanno dimensione X < 1 e le facce risultanti devono essere una U + -- faccio una copia della superfice ed elimino le facce che hanno dimensione X < 1 e le facce risultanti devono essere una U local nTestId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL if nTestId then local bNewIsU @@ -4847,7 +4849,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa bExit = true end end - -- verifico che la componente x delle faccia o deve essere nulla + -- verifico che la componente x della faccia o deve essere nulla local vtN1 = EgtSurfTmFacetNormVersor( nTestId, 0, GDB_ID.ROOT) if bNewIsU and abs( vtN1:getX()) > 0.01 then bNewIsU = false @@ -4855,9 +4857,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- cancello la copia del percorso EgtErase( nTestId) - if bNewIsU then + if bNewIsU and ( not BD.MIN_LEN_LAMELLO or + ( Proc.TotBox and Proc.TotBox:getDimX() > BD.MIN_LEN_LAMELLO) or + ( not Proc.TotBox and Proc.Box:getDimX() > BD.MIN_LEN_LAMELLO)) then -- recupero la lavorazione - if vtN:getZ() < BD.NZ_MINA and BD.DOWN_HEAD then + if BD.DOWN_HEAD and vtN:getZ() < BD.NZ_MINA then sMillingOnSide = ML.FindMilling( 'SideMillAsBlade_H2') else sMillingOnSide = ML.FindMilling( 'SideMillAsBlade') @@ -4879,7 +4883,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa -- 2021.09.17 Su conferma di Fabio Squaratti, se la gola è più streta dell'utensile o la profondità della gole è maggiore -- del valore parametro SIDEDEPTH (preso dalle note utente dell'utensile) allora si prosegue come se non fosse abilitata -- questo tipo di lavorazione SideMillAsBlade - if dDiam >= dThickMillOnSide and dFacElev < dMaxDepthOnSide + 10 * GEO.EPS_SMALL then + if dDiam > dThickMillOnSide - 10 * GEO.EPS_SMALL and dFacElev < dMaxDepthOnSide + 10 * GEO.EPS_SMALL then bSpecialMillOnSide = true -- disabilito eventulae svuotatura sPocketing = nil @@ -5275,7 +5279,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) for i = 1, #vAddId do local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD) local nFct = EgtSurfTmFacetCount( vAddId[i]) - local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, Fct = nFct, Flg = Proc.Flg} + local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg} -- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil) local bOk, sMyWarn bOk, sMyWarn, bPrevBhSideMill = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId, dOvmHead, false, bPrevBhSideMill) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index ca93a9c..8798126 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1,4 +1,4 @@ --- ProcessLongCut.lua by Egaltech s.r.l. 2021/09/08 +-- ProcessLongCut.lua by Egaltech s.r.l. 2021/10/19 -- Gestione calcolo taglio longitudinale per Travi -- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale. -- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto. @@ -276,7 +276,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId) -- cerco la svuotatura opportuna local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX()) if not sPocketing then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + local sErr = 'Error : OpenPocket not found in library' EgtOutLog( sErr) return false, sErr end @@ -307,7 +307,7 @@ local function MakeByPocketing( Proc, nPhase, nRawId, nPartId) if dFacElev > dMaxDepth + 10 * GEO.EPS_SMALL then EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dFacElev) dFacElev = dMaxDepth - sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' : elevation bigger than max tool depth' + sWarn = 'Warning : elevation bigger than max tool depth' EgtOutLog( sWarn) end -- imposto elevazione e dichiaro non si generano sfridi per VMill @@ -460,7 +460,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus if bCanUseUnderBlade then sCuttingDn = ML.FindCutting( 'HeadSide_H2') if not sCuttingDn then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' sawing underneath not found in library' + local sErr = 'Error : sawing HeadSide_H2 not found in library' EgtOutLog( sErr) return false, sErr end @@ -477,7 +477,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus if bCanUseBlade then sCutting = ML.FindCutting( 'HeadSide') if not sCutting then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' sawing not found in library' + local sErr = 'Error : sawing HeadSide not found in library' EgtOutLog( sErr) return false, sErr end @@ -498,7 +498,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus bLimXmin = true else sWarn = 'Warning on saw cut : Cut machining can damage next piece' - EgtOutLog( sWarn .. ' (process ' .. tostring( Proc.Id) .. ')') + EgtOutLog( sWarn) end end -- disabilitato la selezione del codolo, prende sempre quello più piccolo. Non cancellare quello disabiliato in caso di ripristino @@ -639,7 +639,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- se lama da sotto verifico se la componente Y della profondità di taglio supera la capacità della lama if ( nSide == -1 or abs(nSide) == 2) and bCanUseUnderBlade then if (( dWidth - dDimStrip) / 2) > dMaxDepthDn then - local sErr = 'Error, side depth is bigger than underneath blade cut depth' + local sErr = 'Error : side depth is bigger than underneath blade cut depth' EgtOutLog( sErr) return false, sErr end @@ -659,7 +659,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus sMilling = ML.FindMilling( 'Long2Cut', dElev) end if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling Long2Cut (_H2) not found in library' EgtOutLog( sErr) return false, sErr end @@ -869,7 +869,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- recupero la lavorazione local sMilling = ML.FindMilling( 'Long2Cut', dElev) if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' + local sErr = 'Error : milling Long2Cut not found in library' EgtOutLog( sErr) return false, sErr end @@ -1100,12 +1100,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end end if not sMilling then - local sErr = 'Error : milling Long2CutDown not found in library' + local sErr = 'Error : milling Long2CutSide or Long2CutDown not found in library' EgtOutLog( sErr) return false, sErr end if nSide ~= 1 and BD.DOWN_HEAD and not sMillingDn then - local sErr = 'Error : milling Long2CutDown_H2 not found in library' + local sErr = 'Error : milling Long2CutSide_H2 or Long2CutDown_H2 not found in library' EgtOutLog( sErr) return false, sErr end @@ -1256,8 +1256,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dSicOnRad = ( dThDiam - dToolDiam) / 2 dSicOnLegth = dExtraForSafety / 2 end - dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNzMin) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin))) - dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegth) + dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)) +-- dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegth) + dCollSic = max( BD.COLL_SIC, dSicOnRad * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegth) if nSide ~= 1 and BD.DOWN_HEAD then local dSicOnRadDn local dSicOnLegthDn @@ -1268,8 +1269,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dSicOnRadDn = ( dThDiamDn - dToolDiamDn) / 2 dSicOnLegthDn = dExtraForSafety / 2 end - dCollSicMinDn = max( BD.COLL_SIC, ( dThDiamDn - dToolDiamDn) / 2 * EgtIf( abs(dNzMin) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin))) - dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegthDn) + dCollSicMinDn = max( BD.COLL_SIC, ( dThDiamDn - dToolDiamDn) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)) +-- dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getZ(), vtN:getY()) / dNz)) + dSicOnLegthDn) + dCollSicDn = max( BD.COLL_SIC, dSicOnRadDn * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegthDn) if dWidth + dAgg > dMaxDepth - dCollSic then nPass = 2 @@ -1306,8 +1308,9 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dSicOnRad = ( dThDiam - dToolDiam) / 2 dSicOnLegth = dExtraForSafety / 2 end - dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNzMin) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin))) - dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getY(), vtN:getZ()) / dNz)) + dSicOnLegth) + dCollSicMin = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin)) +-- dCollSic = max( BD.COLL_SIC, dSicOnRad * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(nSide) == 1, vtN:getY(), vtN:getZ()) / dNz)) + dSicOnLegth) + dCollSic = max( BD.COLL_SIC, dSicOnRad * abs( EgtIf( abs(vtN:getY()) >= abs(vtN:getZ()), vtN:getZ(), vtN:getY()) / dNzMin) + dSicOnLegth) if dWidth + dAgg > dMaxDepth - dCollSic then sWarn = 'Warning in LongCut : depth is bigger than max tool depth' end @@ -1316,11 +1319,20 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus dDepth = min( dMaxDepth - dCollSicMin, dWidth + dAgg) -- profondità seconda passata dDepth2 = dWidth + dAgg - dDepth + if not BD.DOWN_HEAD then + if nPass == 2 and dDepth2 < dAgg then + dDepth = min( dMaxDepth - dCollSicMin, dWidth + dAgg) / 2 + dDepth2 = dWidth + dAgg - dDepth + end + end if nSide ~= 1 and BD.DOWN_HEAD then dDepthDn = min( dMaxDepthDn - dCollSicMinDn, dWidth + dAgg) dDepth2Dn = dWidth + dAgg - EgtIf( abs(nSide) == 2, dDepth, dDepthDn) + if nPass == 2 and dDepth2Dn < dAgg then + dDepthDn = min( dMaxDepthDn - dCollSicMinDn, dWidth + dAgg) / 2 + dDepth2Dn = dWidth + dAgg - EgtIf( abs(nSide) == 2, dDepth, dDepthDn) + end end - -- ciclo sulle parti local nM = 0 local bMakeMillHeadEnd @@ -1337,6 +1349,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus local dEal = EgtIf( nPos == nC, -dStartDist, -dStartAccDist - ( nC - nPos - 1) * dC + dOverLapExtend) -- Posizione braccio portatesta local nSCC + local dExtraElev_1st = 0 + local dExtraElevDn_1st = 0 for k = 1, nPass do -- if EgtIf( k == 1, bFront, not bFront) then @@ -1395,7 +1409,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- se prima lavorazione non da sotto o seconda lavorazione da sotto e componente Y <= 60° e > 0 if ( ( k == 1 and nSide ~= -1) or ( k == 2 and nSide == -1)) and abs(vtN:getY()) <= 0.866 and abs(vtN:getY()) > GEO.EPS_SMALL then -- verifico se può collidere in base alle dimensione del portapezzo - local dDistToolTh = (dToolLength - EgtIf( k == 1, dDepth, dDepth2) - dThLen) / abs(vtN:getZ()) + local dDistToolTh = (dToolLength - EgtIf( k == 1, dDepth, ( dDepth2 + dExtraElev_1st)) - dThLen) / abs(vtN:getZ()) local dDistRadTh = dDistToolTh * abs(vtN:getY()) local dDistSurf = EgtIf( bFront, b3Solid:getMax():getY() - Proc.Box:getMax():getY(), Proc.Box:getMin():getY() - b3Solid:getMin():getY()) -- raggio portautensile e raggio utensile allora calcolo un arretramento profondità @@ -1468,7 +1482,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end -- se seconda lavorazione sopra e componente Z > 0 elseif k == 2 and nSide == 1 and vtN:getZ() > GEO.EPS_SMALL then - local dDistToolTh = (dToolLength - dDepth2 - dThLen) / abs(vtN:getY()) + local dDistToolTh = (dToolLength - ( dDepth2 + dExtraElev_1st) - dThLen) / abs(vtN:getY()) local dDistRadTh = dDistToolTh * abs(vtN:getZ()) local dDistSurf = Proc.Box:getMin():getZ() - b3Solid:getMin():getZ() -- raggio portautensile e raggio utensile allora calcolo un arretramento profondità @@ -1507,7 +1521,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus end -- se seconda lavorazione di fianco e componente Z > 0 elseif k == 2 and abs(nSide) == 2 and vtN:getZ() > GEO.EPS_SMALL then - local dDistToolThDn = (dToolLengthDn - dDepth2Dn - dThLenDn) / abs(vtN:getY()) + local dDistToolThDn = (dToolLengthDn - ( dDepth2Dn + dExtraElevDn_1st) - dThLenDn) / abs(vtN:getY()) local dDistRadThDn = dDistToolThDn * abs(vtN:getZ()) local dDistSurfDn = Proc.Box:getMin():getZ() - b3Solid:getMin():getZ() -- raggio portautensile e raggio utensile allora calcolo un arretramento profondità @@ -1532,7 +1546,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- se seconda lavorazione da sotto a componente Y < 60° e Y > 0 elseif ( k == 2 and nSide == -1) and abs(vtN:getY()) <= 0.866 and abs(vtN:getY()) > GEO.EPS_SMALL then -- verifico se può collidere in base alle dimensione del portapezzo - local dDistToolThDn = (dToolLengthDn - dDepth2Dn - dThLenDn) / abs(vtN:getY()) + local dDistToolThDn = (dToolLengthDn - ( dDepth2Dn + dExtraElevDn_1st) - dThLenDn) / abs(vtN:getY()) local dDistRadThDn = dDistToolThDn * abs(vtN:getZ()) local dDistSurfDn = EgtIf( bFront, b3Solid:getMax():getY() - Proc.Box:getMax():getY(), Proc.Box:getMin():getY() - b3Solid:getMin():getY()) -- raggio portautensile e raggio utensile allora calcolo un arretramento profondità @@ -1555,11 +1569,13 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus if BD.DOWN_HEAD and k == 2 and nSide ~= 1 then EgtSetMachiningParam( MCH_MP.DEPTH, dDepth2Dn - dExtraElevDn) + dExtraElevDn_1st = dExtraElevDn if dExtraElevDn > 0 and sWarn and #sWarn < 1 then sWarn = 'Warning in LongCut_2 : depth is bigger than max tool depth' end else EgtSetMachiningParam( MCH_MP.DEPTH, EgtIf( k == 1, dDepth, dDepth2) - dExtraElev) + dExtraElev_1st = dExtraElev if dExtraElev > 0 and sWarn and #sWarn < 1 then sWarn = 'Warning in LongCut : depth is bigger than max tool depth' end