From f620269f310fdfd51a96233da1ea95485faef47d Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 5 Oct 2022 10:50:38 +0200 Subject: [PATCH] BugFix/CompiledLua: - in NestProcess fix percorso basedir per avere il funzionamento corretto anche con script compilati - in NestProcess piccolo fix per evitare divisione per 0 --- NestProcess.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/NestProcess.lua b/NestProcess.lua index 745d7d3..0025ac2 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -1,5 +1,6 @@ -- BeamNestProcess.lua by Egaltech s.r.l. 2021/06/14 -- Gestione nesting automatico travi +-- 2022/10/05 Piccole modifiche per far funzionare correttamente i compilati -- Intestazioni require( 'EgtBase') @@ -211,7 +212,10 @@ for ShortIndex = 1, #ShortList do ShortCount = ShortCount + ShortList[ShortIndex].Cnt end local ShortForRaw = floor( ShortCount / MediumRawQty) -local ExtraShortForRaw = fmod( ShortCount, MediumRawQty) +local ExtraShortForRaw = 0 +if MediumRawQty > 0 then + ExtraShortForRaw = fmod( ShortCount, MediumRawQty) +end -- creo lista pezzi corti singoli local SingleShortList = {} for ShortIndex = 1, #ShortList do @@ -329,7 +333,7 @@ while nMachGroup do if EgtGetInfo( nMachGroup, "AUTONEST",'i') == 1 then EgtRemoveInfo( nMachGroup, "AUTONEST") EgtSetInfo( nMachGroup, "UPDATEUI", 1) - local bOk, sErr = pcall( dofile, EgtGetSourceDir() .. "BatchProcessNew.lua") + local bOk, sErr = pcall( dofile, BEAM.BASEDIR .. "\\BatchProcessNew.lua") if not bOk then EgtOutLog( 'Error in BatchProcessNew.lua call (' .. ( sErr or '') ..')') end