diff --git a/BatchProcess.lua b/BatchProcess.lua index 8cd5987..b4b921f 100644 --- a/BatchProcess.lua +++ b/BatchProcess.lua @@ -242,6 +242,9 @@ if bToProcess then vWall[i].PosZ = PosZ end + -- Recupero informazione se progetto o produzione + local bProj = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo'), 'PROJECT', 'i') == 1) + -- Eseguo eventuali rotazioni e inversioni testa-coda for i = 1, #vWall do local b3Solid = vWall[i].Box @@ -264,8 +267,8 @@ if bToProcess then end EgtSetInfo( vWall[i].Id, 'INVERTED_DONE', dInvAng) end - -- correzioni per rotazioni non centrate di TS3 (quasi sempre 0 o 180 deg) - if dRotAng and dInvAng then + -- correzioni per rotazioni non centrate di produzioni TS3 (quasi sempre 0 o 180 deg) + if not bProj and dRotAng and dInvAng then if abs( dInvAng) > GEO.EPS_ANG_SMALL then vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() if abs( dRotAng) < GEO.EPS_ANG_SMALL then diff --git a/LuaLibs/WProcessFreeContour.lua b/LuaLibs/WProcessFreeContour.lua index fcd856a..422350f 100644 --- a/LuaLibs/WProcessFreeContour.lua +++ b/LuaLibs/WProcessFreeContour.lua @@ -1,4 +1,4 @@ --- ProcessFreeContour.lua by Egaltech s.r.l. 2020/07/08 +-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/07/13 -- Gestione calcolo profilo libero per Pareti -- Tabella per definizione modulo @@ -345,15 +345,6 @@ local function MakeByCut( Proc, nRawId, b3Raw) EgtOutLog( sErr) return false, sErr end - -- recupero la lavorazione di fresatura - local sMilling, dMillMaxDepth = WM.FindMilling( 'FreeContour') - if not sMilling then - local sErr = 'Error : milling not found in library' - EgtOutLog( sErr) - return false, sErr - end - -- recupero la lavorazione con sega a catena - local sSawing = WM.FindSawing( 'Sawing') -- recupero la lavorazione di taglio con lama e i suoi parametri local sCutting, dSawDiam, dSawThick, dSawMaxDepth = WM.FindCutting( 'Standard') if not sCutting then @@ -472,8 +463,20 @@ local function MakeByCut( Proc, nRawId, b3Raw) -- inserimento dei tagli di lama local bCtOk, sCtErr = AddCuts( sCutting, vFace, Proc, nRawId, b3Raw) if not bCtOk then return bCtOk, sCtErr end + -- recupero la lavorazione con sega a catena + local sSawing = WM.FindSawing( 'Sawing') + -- recupero la lavorazione di fresatura + local sMilling, dMillMaxDepth = WM.FindMilling( 'FreeContour', dMaxWidth + WD.CUT_EXTRA) + if not sMilling and not sSawing then + local sMilling = WM.FindMilling( 'FreeContour') + if not sMilling then + local sErr = 'Error : milling not found in library' + EgtOutLog( sErr) + return false, sErr + end + end -- se possibile, inserimento delle fresature - if dMaxWidth + WD.CUT_EXTRA < dMillMaxDepth then + if sMilling then local bMlOk, sMlErr = AddMillings( sMilling, vFace, Proc, nRawId, b3Raw) if not bMlOk then return bMlOk, sMlErr end -- altrimenti provo con la sega a catena diff --git a/Process.lua b/Process.lua index 62d556e..cf80afe 100644 --- a/Process.lua +++ b/Process.lua @@ -99,6 +99,9 @@ local function MyProcessInputData() vWall[i].PosZ = PosZ end + -- Recupero informazione se progetto o produzione + local bProj = ( EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo'), 'PROJECT', 'i') == 1) + -- Eseguo eventuali rotazioni e inversioni testa-coda for i = 1, #vWall do local b3Solid = vWall[i].Box @@ -121,8 +124,8 @@ local function MyProcessInputData() end EgtSetInfo( vWall[i].Id, 'INVERTED_DONE', dInvAng) end - -- correzioni per rotazioni non centrate di TS3 (quasi sempre 0 o 180 deg) - if dRotAng and dInvAng then + -- correzioni per rotazioni non centrate di produzioni di TS3 (quasi sempre 0 o 180 deg) + if not bProj and dRotAng and dInvAng then if abs( dInvAng) > GEO.EPS_ANG_SMALL then vWall[i].PosX = vWall[i].PosX - vWall[i].Box:getDimX() if abs( dRotAng) < GEO.EPS_ANG_SMALL then