diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 95fc73f..d2f7d1f 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -1,4 +1,4 @@ --- MachiningLib.lua by Egaltech s.r.l. 2020/11/13 +-- MachiningLib.lua by Egaltech s.r.l. 2021/04/14 -- Libreria ricerca lavorazioni per Travi -- Tabella per definizione modulo @@ -38,16 +38,18 @@ function MachiningLib.FindCutting( sType) end --------------------------------------------------------------------- -function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam) +function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen) for i = 1, #Millings do local Milling = Millings[i] if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then local sTuuid = EgtGetMachiningParam( MCH_MP.TUUID) local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) + local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) if ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and ( not sTuuidMstr or sTuuidMstr == sTuuid) and - ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) then + ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and + ( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then return Milling.Name, dTMaxDepth, dTDiam end end @@ -55,14 +57,16 @@ function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam) end --------------------------------------------------------------------- -function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth) +function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen) for i = 1, #Pocketings do local Pocketing = Pocketings[i] if Pocketing.On and Pocketing.Type == sType and SetCurrMachiningAndTool( Pocketing.Name) then local dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() + local dTTotLen = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) if ( not dMaxDiam or dTDiam < dMaxDiam + GEO.EPS_SMALL) and - ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then + ( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) and + ( not dMaxTotLen or dTTotLen < dMaxTotLen + GEO.EPS_SMALL) then return Pocketing.Name, dTDiam, dTMaxDepth end end diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index fc73be6..bd43572 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,5 +1,6 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2021/03/20 +-- ProcessDrill.lua by Egaltech s.r.l. 2021/04/14 -- Gestione calcolo forature per Travi +-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile. -- Tabella per definizione modulo local ProcessDrill = {} @@ -212,22 +213,21 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) dCheckDepth2 = nil end -- abilitazione foratura da sotto - --local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getY() > 0 or EgtExistsInfo( Proc.Id, 'MAIN')) and not EgtExistsInfo( Proc.Id, 'DOU')) + local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or vtExtr:getZ() < 0.259)) local bDrillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) - local bDrillDown = ( BD.DOWN_HEAD and ( Proc.Down or vtExtr:getZ() < -0.1 or ( vtExtr:getZ() < 0.259 and vtExtr:getY() > 0))) -- primo gruppo di controlli con lunghezza utensile calcolata -- recupero la lavorazione - local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillDown) + local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillDown) if not sDrilling then -- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile if dCheckDepth then - sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown) + sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown) if sDrilling then dCheckDepth = nil end end if not sDrilling and bDrillUp then - sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth) - if dCheckDepth then - sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0) + sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth) + if not sDrilling and dCheckDepth then + sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0) if sDrilling then dCheckDepth = nil end end end @@ -243,7 +243,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) nErrorCode = 2 -- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto) else - sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown) + sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillDown) + if not sDrilling and bDrillUp then + sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0) + end if not sDrilling then nErrorCode = 1 end @@ -255,14 +258,21 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) end -- secondo gruppo di controlli con lunghezza utensile calcolata -- recupero la lavorazione - local sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 + local sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 if dDepth2 > dDepth + BD.DRILL_OVERLAP then - sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2, bDrillDown) + sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2, bDrillDown) if not sDrilling2 then -- se ho passato altezza di taglio utensile allora rifaccio la ricerca senza passare altezza utensile if dCheckDepth2 then - dCheckDepth2 = nil - sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown) + sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown) + if sDrilling2 then dCheckDepth2 = nil end + end + if not sDrilling2 and bDrillUp then + sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, dCheckDepth2) + if not sDrilling2 and dCheckDepth2 then + sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0) + if sDrilling2 then dCheckDepth2 = nil end + end end if not sDrilling2 then nErrorCode = 1 @@ -276,7 +286,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) nErrorCode = 2 -- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto) else - sDrilling2, nType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown) + sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0, bDrillDown) + if not sDrilling2 and bDrillUp then + sDrilling2, sType2, dMaxDepth2, dMaxToolLength2, dToolDiam2, dDiamTh2, dToolFreeLen2 = ML.FindDrilling( dDiam, 0) + end if not sDrilling2 then nErrorCode = 1 end @@ -304,7 +317,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) --------------------------------------------------------------------------------------------------------------------------------------------------------- elseif nErrorCode == 0 and not bToInvert and bCommonCompare and abs(vtExtr:getY()) > 0.866 and Proc.Flg == 2 and dMaxToolLength2 > BD.MAX_TOOL_LEN_BACK_HOR_MACH then sDrilling = sDrilling2 - nType = nType2 + sType = sType2 dMaxDepth = dMaxDepth2 dToolDiam = dToolDiam2 dDiamTh = dDiamTh2 @@ -332,8 +345,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) local dSubL3 = 0 local dDeltaRad = ( Proc.Diam - dToolDiam) / 2 -- se foro non su testa o coda e inclinato, limito il massimo affondamento + local bInMid = false local bInvertFcse = ( bToInvert and Proc.Flg ~= -2) if ( not bInvertFcse and Proc.Fcs ~= 5 and Proc.Fcs ~= 6) or ( bInvertFcse and Proc.Fce ~= 5 and Proc.Fce ~= 6) then + bInMid = true local CosB = abs( vtExtr:getX()) if CosB < BD.DRILL_VX_MAX then local TgA = CosB / sqrt( 1 - CosB * CosB) @@ -345,6 +360,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- se foro davanti o dietro e inclinato, limito il massimo affondamento if dMaxDepth > 0 and abs( vtExtr:getY()) > abs( vtExtr:getZ()) then local CosB = abs( vtExtr:getZ()) + if bInMid then + CosB = sqrt( vtExtr:getZ() * vtExtr:getZ() + vtExtr:getX() * vtExtr:getX()) + end if CosB < BD.DRILL_VX_MAX then local TgA = CosB / sqrt( 1 - CosB * CosB) dSubL2 = ( dDiamTh / 2 + dDeltaRad + 2) * TgA @@ -355,6 +373,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- se foro sopra o sotto e inclinato, limito il massimo affondamento if dMaxDepth > 0 and abs( vtExtr:getZ()) > abs( vtExtr:getY()) then local CosB = abs( vtExtr:getY()) + if bInMid then + CosB = sqrt( vtExtr:getY() * vtExtr:getY() + vtExtr:getX() * vtExtr:getX()) + end if CosB < BD.DRILL_VX_MAX then local TgA = CosB / sqrt( 1 - CosB * CosB) dSubL3 = ( dDiamTh / 2 + dDeltaRad + 2) * TgA @@ -377,7 +398,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- aggiungo geometria EgtSetMachiningGeometry( {{ AuxId, -1}}) -- eventuale inversione - if nType == 'Drill' then + if sType == 'Drill' or sType == 'Drill_H2' then EgtSetMachiningParam( MCH_MP.INVERT, bToInvert) else EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert) @@ -410,7 +431,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- Note utente con dichiarazione nessuna generazione sfridi per Vmill local sUserNotes = 'VMRS=0;' -- se foratura - if nType == 'Drill' then + if sType == 'Drill' or sType == 'Drill_H2' then -- aggiungo alle note massima elevazione (coincide con affondamento) sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dDepth, 1) .. ';' -- se foro passante, aggiungo questa qualifica alle note @@ -428,7 +449,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) -- eseguo local bOk = EgtApplyMachining( true, false) if not bOk and BD.DOWN_HEAD then - if nType == 'Drill' then + if sType == 'Drill' or sType == 'Drill_H2' then EgtSetMachiningParam( MCH_MP.INVERT, true) else EgtSetMachiningParam( MCH_MP.TOOLINVERT, true) diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 29307bd..837e555 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,6 +1,7 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2021/04/08 +-- ProcessDtMortise.lua by Egaltech s.r.l. 2021/04/14 -- Gestione calcolo mortase a coda di rondine per Travi -- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. +-- 2021/04/08 Miglioria scelta lavorazione in presenza di testa da sotto. -- Tabella per definizione modulo local ProcessDtMortise = {} @@ -175,16 +176,28 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) dMinRad = dRad end end + -- abilitazione lavorazione da sotto + local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259) + local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174) + -- recupero la lavorazione + local sMillType = 'DtMortise' + local sMchExt = EgtIf( bMillDown, '_H2', '') -- recupero la lavorazione : prima ricerca per sola tipologia - local sMchExt = EgtIf( bFaceDown or ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1), '_H2', '') - local sMilling = ML.FindMilling( 'DtMortise'..sMchExt) + local sMilling = ML.FindMilling( sMillType..sMchExt) + if not sMilling and bMillUp then + sMilling = ML.FindMilling( sMillType) + end if not sMilling then local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id) EgtOutLog( sErr) return false, sErr end -- recupero la lavorazione : seconda ricerca con tipologia e diametro massimo - sMilling = ML.FindMilling( 'DtMortise'..sMchExt, nil, nil, 2 * dMinRad) + sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, 2 * dMinRad) + if not sMilling and bMillUp then + sMilling = ML.FindMilling( sMillType, nil, nil, 2 * dMinRad) + sMchExt = '' + end if not sMilling then local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id) EgtOutLog( sErr) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index cb10951..80796fa 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2021/03/22 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2021/04/14 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. @@ -7,6 +7,9 @@ -- 2021/03/04 Due facce con testa da sotto. -- 2021/03/20 Piccole correzioni. -- 2021/03/22 Modificata gestione caso due facce lunghe come la trave con trave corta. +-- 2021/04/13 Modificata gestione fessura U con sega a catena (corta ora ok, lunga ancora da correggere). +-- 2021/04/14 Correzioni ribasso a U con fresa da sotto. +-- 2021/04/15 Aggiunta gestione massima lunghezza fresa da sotto su svuotature. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -742,27 +745,25 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId, bDownHead) end -- verifico il numero di facce della tacca assert( ( Proc.Fct == 2), 'Error : MakeTwoFacesByMill in LapJoint with ' .. tostring( Proc.Fct) .. ' faces') - -- predispongo lavorazione - local sMilling - -- verifico il parametro Q per uso fresa + -- recupero il parametro Q per uso fresa local nUseRM = EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') + -- recupero la lavorazione + local sMilling if nUseRM and nUseRM == 1 then sMilling = ML.FindMilling( 'LongSmallCut' .. EgtIf( bDownHead, '_H2', '')) else sMilling = ML.FindMilling( 'BirdsMouth' .. EgtIf( bDownHead, '_H2', '')) end - -- recupero la lavorazione - local dTDiam = 0 if not sMilling then local sErr = 'Error : LongSmallCut & BirdsMouth not found in library' EgtOutLog( sErr) return false, sErr - else - -- recupero i dati dell'utensile - if EgtMdbSetCurrMachining( sMilling) then - local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) - dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam - end + end + -- recupero i dati dell'utensile + local dTDiam = 0 + if EgtMdbSetCurrMachining( sMilling) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam end -- dati delle facce local ptC = {} @@ -1959,8 +1960,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end if bOrthoFaces then - -- ottengo le dimensioni del tunnel - _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId) + -- ottengo le dimensioni del tunnel + dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId) -- verifico la direzione -- se devo inserire il chamfer if nChamfer > 0 then @@ -2715,15 +2716,17 @@ local function CheckPocketTool( sMchFind, dDiam, dElev) end --------------------------------------------------------------------- -local function CheckToolDiamByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, dElev, nUseRoughTool) +local function CheckToolDiamByFaces( Proc, nFacInd, bFaceDown, dH, dV, bIsU, bIsL, dElev, nUseRoughTool) local dMaxDimFace = max( dH, dV) -- verifico che diametro utensile prende con la openpocket con la massima dimensione faccia local bUseMaxTool, dMaxDiam + -- classe di lavorazione + local sMach = 'OpenPocket' .. EgtIf( bFaceDown, '_H2', '') -- se è forzato l'uso del truciolatore non passo l'altezza di elevazione if nUseRoughTool and nUseRoughTool == 1 then - bUseMaxTool, dMaxDiam = CheckPocketTool( 'OpenPocket', dMaxDimFace) + bUseMaxTool, dMaxDiam = CheckPocketTool( sMach, dMaxDimFace) else - bUseMaxTool, dMaxDiam = CheckPocketTool( 'OpenPocket', dMaxDimFace, dElev) + bUseMaxTool, dMaxDiam = CheckPocketTool( sMach, dMaxDimFace, dElev) end -- se non trovato utensile esco if not bUseMaxTool then @@ -3437,6 +3440,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa elseif abs( vtN:getX()) > 0.707 or abs( vtN:getY()) > 0.707 or abs( vtN:getZ()) > 0.707 then dCollSic = 5 * BD.COLL_SIC end + -- abilitazione lavorazione da sotto + local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259) + local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342) -- settaggio voluto da Alessandro local sMchFind = EgtIf( bSinglePart, 'Pocket', 'OpenPocket') sMchFindBackUp = sMchFind @@ -3480,7 +3486,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa if ( Proc.Fct == 3 and bIsU and bSinglePart) or ( Proc.Fct == 2 and bIsL) or Proc.Fct == 1 then sMchFindBackUp = sMchFind --ottengo un diametro utensile opportuno - dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckToolDiamByFaces( Proc, nFacInd, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool) + dDiam, sMchFind, nUseRoughTool, dDiamMax = CheckToolDiamByFaces( Proc, nFacInd, bMillDown, dH, dV, bIsU, bIsL, ( dFacElev + dCollSic), nUseRoughTool) if not dDiam then sMchFind = sMchFindBackUp --if nUseRoughTool == 0 then @@ -3499,15 +3505,17 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa end end end - -- abilitazione lavorazione da sotto - local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259) - local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342) --EgtOutLog( 'Mortise Find Diam =' .. EgtNumToString( dDiam)) + -- se da sotto, imposto massima lunghezza secondo la direzione + local dMaxTotLen + if bMillDown and BD.GetBottomToolMaxTotLen then + dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN) + end -- ricerca lavorazione local sPocketing - local sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind .. EgtIf( bMillDown, '_H2', ''), dDiam, dFacElev + dCollSic) + local sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind .. EgtIf( bMillDown, '_H2', ''), dDiam, dFacElev + dCollSic, dMaxTotLen) if not sMyPocketing then - sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind .. EgtIf( bMillDown, '_H2', ''), dDiam) + sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind .. EgtIf( bMillDown, '_H2', ''), dDiam, nil, dMaxTotLen) end if not sMyPocketing and bMillUp then sMyPocketing, dMyTDiam, dMyTMaxDepth = ML.FindPocketing( sMchFind, dDiam, dFacElev + dCollSic)