diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 58e38cc..bf3ee34 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -1,4 +1,4 @@ --- ProcessDtMortise.lua by Egaltech s.r.l. 2020/10/09 +-- ProcessDtMortise.lua by Egaltech s.r.l. 2020/10/18 -- Gestione calcolo mortase a coda di rondine per Travi -- Tabella per definizione modulo @@ -192,6 +192,54 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) return false, sErr end end + -- se con tasca, la lavoro + if bPocket then + -- recupero il contorno della tasca (seconda curva ausiliaria) + local sVal = EgtGetInfo( Proc.Id, 'AUXID') + local vsAuxId = EgtSplitString( sVal) + local Aux2Id + if vsAuxId and #vsAuxId >=2 then + Aux2Id = tonumber( vsAuxId[2]) + end + if Aux2Id then Aux2Id = Aux2Id + Proc.Id end + if not Aux2Id or ( EgtGetType( Aux2Id) & GDB_FY.GEO_CURVE) == 0 then + local sErr = 'Missing pocket geometry : Error on DtMortise ' .. tostring( Proc.Id) + EgtOutLog( sErr) + return false, sErr + end + -- recupero la lavorazione + local sPocketing + if Proc.Prc ~= 53 then + sPocketing = ML.FindPocketing( 'Mortise', dToolDiam) + end + if not sPocketing then + sPocketing = ML.FindPocketing( 'Pocket', dToolDiam) + end + if not sPocketing then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' pocketing not found in library' + EgtOutLog( sErr) + return false, sErr + end + -- inserisco la lavorazione di svuotatura + local sName = 'DtMtPck_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchFId = EgtAddMachining( sName, sPocketing) + if not nMchFId then + local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ Aux2Id, -1}}) + -- dichiaro non si generano sfridi per VMill + local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. '; VMRS=0;' + EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) + -- eseguo + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchFId, false) + return false, sErr + end + end -- se parametro interno abilitato e il percorso non รจ chiuso, aggiungo percorso e lavorazione antischeggia if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then -- recupero il riferimento della faccia di fondo