5 Commits

Author SHA1 Message Date
Emmanuele Sassi 015591fea9 Merge branch 'feature/ThirdMachineNoBigParts' 2025-06-30 10:36:15 +02:00
Emmanuele Sassi 42a4479df7 - correzzione per lavorazioni su macchina offline
- aggiunta gestione mutex per evitare lanci multipli dello script
2025-06-30 10:32:37 +02:00
Emmanuele Sassi 708307d345 - eliminate modifiche per pezzi grandi 2023-10-19 09:30:33 +02:00
Emmanuele Sassi f4baf8a43b - gestione pezzi grandi quasi quanto il foglio 2023-10-10 18:53:12 +02:00
Emmanuele Sassi c8d4a28d22 - file di configurazione funzioni Egt 2023-10-05 18:04:23 +02:00
4 changed files with 210 additions and 24 deletions
+155
View File
@@ -0,0 +1,155 @@
{
"Lua.diagnostics.globals": [
"EgtProtectGlobal",
"EgtOutLog",
"GDB_ID",
"EgtGetFirstNameInGroup",
"EgtImportDxf",
"EgtGetLastInGroup",
"EgtGetNextPart",
"EgtGetLastPart",
"EgtSetInfo",
"EgtSetName",
"EgtGetFirstLayer",
"EgtGetName",
"EgtGetFirstInGroup",
"EgtGetType",
"GDB_TY",
"EgtCurveThickness",
"EgtModifyCurveThickness",
"EgtCurveIsClosed",
"EgtTrimCurveStartAtLen",
"EgtSP",
"EgtEP",
"EgtTrimCurveEndAtLen",
"EgtCloseCurveCompo",
"EgtCurveAreaXY",
"abs",
"EgtGetNext",
"EgtInvertCurve",
"EgtGetBBox",
"GDB_BB",
"EgtGroup",
"EgtTextAdv",
"Point3d",
"GDB_TI",
"EgtSetColor",
"BBox3d",
"EgtRotate",
"ORIG",
"Z_AX",
"EgtCopy",
"EgtSurfFlatRegion",
"Color3d",
"EgtSetStatus",
"GDB_ST",
"EgtMdbSetCurrMachining",
"EgtMdbGetCurrMachiningParam",
"EgtTdbSetCurrTool",
"EgtTdbGetCurrToolParam",
"MCH_MP",
"EgtOffsetCurveAdv",
"EgtRelocateGlob",
"MCH_TP",
"EgtCurveWithRegionClassify",
"GDB_CRC",
"EgtErase",
"EgtGetBBoxGlob",
"EgtInvertSurf",
"EgtGetInfo",
"EgtAutoNestAddPart",
"EgtAutoNestAddHoleToPart",
"EgtAutoNestAddToolOutlineToPart",
"EgtSetCurrMachine",
"V_NULL",
"EgtAutoNestGetOneResult",
"EgtSetCurrMachGroup",
"EgtGetFirstRawPart",
"EgtGetParent",
"EgtGetMachGroupNewName",
"EgtAddMachGroup",
"EgtGetCurrMachGroup",
"EgtGetMachGroupId",
"EgtMirror",
"Y_AX",
"GDB_RT",
"EgtMove",
"Vector3d",
"EgtAddPartToRawPart",
"EgtZoom",
"SCE_ZM",
"EgtAutoNestStart",
"EgtResetCurrMachGroup",
"EgtRectangle2P",
"EgtGetFirstPartInRawPart",
"EgtGetNextPartInRawPart",
"EgtAutoNestAddSheet",
"EgtAutoNestAddDefectToSheet",
"EgtAutoNestSetInterpartGap",
"EgtAutoNestCompute",
"EgtAutoNestGetComputationStatus",
"EgtAutoNestGetResults",
"EgtProcessEvents",
"EgtAutoNestCancelComputation",
"EgtGetCurrMachineName",
"EgtGetMachiningGeometry",
"EgtExistsObj",
"EgtGetMachiningParam",
"EgtSetCurrMachining",
"EgtGetMachiningEndPoint",
"EgtSpInit",
"EgtSpAddPoint",
"SHP_OB",
"EgtSpSetOpenBound",
"EgtSpCalculate",
"SHP_TY",
"EgtSpTerminate",
"GDB_IN",
"EgtGetRawPartCenter",
"sqrt",
"EgtSpSetZzOwStep",
"EgtGetCurrPhase",
"EgtGetPhaseDisposition",
"EgtCreateDirectory",
"EgtGetFirstMachGroup",
"EgtGetNextMachGroup",
"EgtImportSetup",
"EgtGetRawPartBBox",
"EgtLine",
"tointeger",
"floor",
"EgtAddMachining",
"EgtSetMachiningGeometry",
"EgtApplyMachining",
"EgtSurfFrAdd",
"EgtSurfFrSubtract",
"EgtExplodeSurf",
"EgtTrimCurveWithRegion",
"MCH_MILL_WS",
"EgtSetMachiningParam",
"MCH_MILL_LI",
"EgtApplyAllMachinings",
"EgtEstimate",
"EgtCopyFile",
"EgtEraseFile",
"EgtSetMachineLook",
"MCH_LOOK",
"EgtExportSvg",
"EgtGetFirstGroupInGroup",
"EgtGetNextGroup",
"EgtCopyGlob",
"EgtGetNextName",
"EnclosesXY",
"EgtGenerate",
"EgtCurveLength",
"EgtGetCalcColor",
"EgtRemoveOperation",
"EgtArcRadius",
"GEO",
"min",
"EgtExplodeCurveCompo",
"EgtCurveCompo",
"EgtAddCurveCompoCurve",
"AreSameColor"
]
}
+2 -2
View File
@@ -161,7 +161,7 @@ Config.Kerf = {{MatId = 1, MatExtCode = 6120, Kerf = 8},
{MatId = 11, MatExtCode = 6423, Kerf = 20}, {MatId = 11, MatExtCode = 6423, Kerf = 20},
{MatId = 12, MatExtCode = 112268, Kerf = 20}, {MatId = 12, MatExtCode = 112268, Kerf = 20},
{MatId = 13, MatExtCode = 119169, Kerf = 20}, {MatId = 13, MatExtCode = 119169, Kerf = 20},
{MatId = 14, MatExtCode = 121214, Kerf = 20}, {MatId = 14, MatExtCode = 121214, Kerf = 10},
{MatId = 15, MatExtCode = 111625, Kerf = 20}, {MatId = 15, MatExtCode = 111625, Kerf = 20},
{MatId = 16, MatExtCode = 6127, Kerf = 20}, {MatId = 16, MatExtCode = 6127, Kerf = 20},
{MatId = 17, MatExtCode = 6044, Kerf = 20}, {MatId = 17, MatExtCode = 6044, Kerf = 20},
@@ -174,7 +174,7 @@ Config.Kerf = {{MatId = 1, MatExtCode = 6120, Kerf = 8},
{MatId = 26, MatExtCode = 127662, Kerf = 20}, {MatId = 26, MatExtCode = 127662, Kerf = 20},
{MatId = 27, MatExtCode = 127663, Kerf = 20}, {MatId = 27, MatExtCode = 127663, Kerf = 20},
{MatId = 28, MatExtCode = 127664, Kerf = 20}, {MatId = 28, MatExtCode = 127664, Kerf = 20},
{MatId = 29, MatExtCode = 127665, Kerf = 20}, {MatId = 29, MatExtCode = 127665, Kerf = 10},
} }
Config.KitXModel = {{Model = '65w981', KitQty = 6}, Config.KitXModel = {{Model = '65w981', KitQty = 6},
+9 -2
View File
@@ -279,7 +279,7 @@ function Nesting(readBatch)
local MatSheetList = {} local MatSheetList = {}
--for Material = 1, #materials do --for Material = 1, #materials do
for Material = MatIndex, MatCount do for Material = MatIndex, MatCount do
--for Material = 2, 2 do -- for Material = 15, 15 do
--for Material = 4, 4 do --for Material = 4, 4 do
-- se è il materiale nullo salto al prossimo -- se è il materiale nullo salto al prossimo
if materials[Material].MatId ~= 0 and #materials[Material].PriorityList > 0 then if materials[Material].MatId ~= 0 and #materials[Material].PriorityList > 0 then
@@ -388,6 +388,7 @@ function Nesting(readBatch)
-- calcolo lavorazioni, stime, ecc -- calcolo lavorazioni, stime, ecc
NestingLib.PostNestOp(materials[Material], ErrorList, false, readBatch.BatchId, 1) NestingLib.PostNestOp(materials[Material], ErrorList, false, readBatch.BatchId, 1)
NestingLib.PostNestOp(materials[Material], ErrorList, false, readBatch.BatchId, 2) NestingLib.PostNestOp(materials[Material], ErrorList, false, readBatch.BatchId, 2)
NestingLib.PostNestOp(materials[Material], ErrorList, false, readBatch.BatchId, 3)
if ManageError(ErrorList, readBatch) then return end if ManageError(ErrorList, readBatch) then return end
-- salvo il progetto di nesting -- salvo il progetto di nesting
@@ -1089,6 +1090,12 @@ function ExtendedEstimate(readBatch)
end end
-- --
-- verifico che non ci siano istanze gia' in corso
if not EgtCreateMutex('Global\\MainNKCLuaScript') then
EgtOutLog( 'Impossible starting script! Script already in execution!')
EgtOutBox( 'Script already running! Impossible running another instance at the same time!!', 'Error' , 'ERROR', 'OK')
EgtCloseExe()
end
-- ciclo principale -- ciclo principale
while true do while true do
EgtNewFile() EgtNewFile()
@@ -1114,5 +1121,5 @@ while true do
end end
end end
end end
end end
EgtReleaseMutex()
+44 -20
View File
@@ -131,7 +131,7 @@ function NestingLib.FilterPaintedParts(OrderList, materials, ErrorList)
end end
-- ordino per modelli kit -- ordino per modelli kit
function compareOrderExtCode(a,b) local function compareOrderExtCode(a,b)
return a.OrderCod < b.OrderCod return a.OrderCod < b.OrderCod
end end
table.sort(OrderList, compareOrderExtCode) table.sort(OrderList, compareOrderExtCode)
@@ -602,7 +602,7 @@ local function AddPartListToNesting(PartList, ErrorList, Material)
end end
-- se entro la tolleranza -- se entro la tolleranza
if -OutlineDepth >= (Material.T_mm - Config.ThicknessTolerance) and -OutlineDepth <= (Material.T_mm + Config.ThicknessTolerance) then if -OutlineDepth >= (Material.T_mm - Config.ThicknessTolerance) and -OutlineDepth <= (Material.T_mm + Config.ThicknessTolerance) then
EgtModifyCurveThickness(OutlineId, -Material.T_mm) EgtModifyCurveThickness(OutlineId, - Material.T_mm)
end end
-- se il percorso non è chiuso -- se il percorso non è chiuso
if not EgtCurveIsClosed(OutlineId) then if not EgtCurveIsClosed(OutlineId) then
@@ -897,6 +897,9 @@ local function SetMachineByIndex(MachId)
elseif MachId == 2 then elseif MachId == 2 then
sCurrMachName = "Multiax-NE_Nest02" sCurrMachName = "Multiax-NE_Nest02"
EgtSetCurrMachine(sCurrMachName) EgtSetCurrMachine(sCurrMachName)
elseif MachId == 3 then
sCurrMachName = "Multiax-NE_Nest03"
EgtSetCurrMachine(sCurrMachName)
end end
end end
-- --
@@ -915,6 +918,7 @@ local function CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList
local Sheet = {PartList = {}} local Sheet = {PartList = {}}
local bFirstSheet = true local bFirstSheet = true
local nMach2SheetId = FirstMachIndex local nMach2SheetId = FirstMachIndex
local nMach3SheetId = FirstMachIndex
for i = 0, 999 do for i = 0, 999 do
local nType, nId, nFlag, dX, dY, dAngRot = EgtAutoNestGetOneResult( i) local nType, nId, nFlag, dX, dY, dAngRot = EgtAutoNestGetOneResult( i)
if not nType then break end if not nType then break end
@@ -932,6 +936,9 @@ local function CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList
if MachId == 2 then if MachId == 2 then
nRawId = EgtGetInfo(nRawId, 'LastRaw2') nRawId = EgtGetInfo(nRawId, 'LastRaw2')
EgtSetCurrMachGroup(EgtGetParent(EgtGetParent(nRawId))) EgtSetCurrMachGroup(EgtGetParent(EgtGetParent(nRawId)))
elseif MachId == 3 then
nRawId = EgtGetInfo(nRawId, 'LastRaw3')
EgtSetCurrMachGroup(EgtGetParent(EgtGetParent(nRawId)))
end end
-- imposto foglio -- imposto foglio
Sheet = Material.SheetList[#Material.SheetList] Sheet = Material.SheetList[#Material.SheetList]
@@ -947,6 +954,10 @@ local function CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList
--MachGroupName = "Sheet" .. nRaw1Id --MachGroupName = "Sheet" .. nRaw1Id
MachGroupName = EgtGetMachGroupNewName("M2_Sheet") MachGroupName = EgtGetMachGroupNewName("M2_Sheet")
MachGroupName = "M2Sheet" .. nMach2SheetId MachGroupName = "M2Sheet" .. nMach2SheetId
elseif MachId == 3 then
nMach3SheetId = nMach3SheetId + 1
MachGroupName = EgtGetMachGroupNewName("M3_Sheet")
MachGroupName = "M3Sheet" .. nMach3SheetId
else else
MachGroupName = "Sheet" .. #Material.SheetList + 1 --SheetCounter MachGroupName = "Sheet" .. #Material.SheetList + 1 --SheetCounter
end end
@@ -956,10 +967,14 @@ local function CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList
-- end -- end
local bOk = EgtAddMachGroup(MachGroupName, sCurrMachName) local bOk = EgtAddMachGroup(MachGroupName, sCurrMachName)
-- se macchina 2 aggiungo info e riferimento a foglio della macchina 1 -- se macchina 2 aggiungo info e riferimento a foglio della macchina 1
if MachId ==2 then if MachId == 2 then
EgtSetInfo(EgtGetCurrMachGroup(), 'MachId', MachId) EgtSetInfo(EgtGetCurrMachGroup(), 'MachId', MachId)
local nOrigSheetId = EgtGetMachGroupId("Sheet" .. nMach2SheetId) local nOrigSheetId = EgtGetMachGroupId("Sheet" .. nMach2SheetId)
EgtSetInfo(EgtGetCurrMachGroup(), 'OrigSheetId', nOrigSheetId) EgtSetInfo(EgtGetCurrMachGroup(), 'OrigSheetId', nOrigSheetId)
elseif MachId == 3 then
EgtSetInfo(EgtGetCurrMachGroup(), 'MachId', MachId)
local nOrigSheetId = EgtGetMachGroupId("Sheet" .. nMach3SheetId)
EgtSetInfo(EgtGetCurrMachGroup(), 'OrigSheetId', nOrigSheetId)
end end
-- imposto tavola -- imposto tavola
local vtOffs = UtilityLib.SetupMachineTable(IsOffline) local vtOffs = UtilityLib.SetupMachineTable(IsOffline)
@@ -983,7 +998,7 @@ local function CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList
--EgtOutLog( string.format( ' Part %d pos=%f,%f rot=%f flip=%d', nId, dX, dY, dAngRot, nFlag)) --EgtOutLog( string.format( ' Part %d pos=%f,%f rot=%f flip=%d', nId, dX, dY, dAngRot, nFlag))
-- se ho un grezzo valido metto i pezzi -- se ho un grezzo valido metto i pezzi
local PartId = nId local PartId = nId
if MachId ~= 2 then if MachId ~= 2 and MachId ~= 3 then
if nFlag ~= 0 then if nFlag ~= 0 then
EgtMirror( PartId, ORIG(), Y_AX(), GDB_RT.GLOB) EgtMirror( PartId, ORIG(), Y_AX(), GDB_RT.GLOB)
end end
@@ -1056,7 +1071,7 @@ function NestingLib.NestPartInRawPart(LastRaw, PartList, Material, ErrorList, Is
dKerf = Config.Kerf[Index].Kerf dKerf = Config.Kerf[Index].Kerf
end end
end end
-- verifico se ultimo grezzo non nullo -- verifico se ultimo grezzo non nullo
local LastMachGroupId = nil local LastMachGroupId = nil
if LastRaw and LastRaw ~= GDB_ID.NULL then if LastRaw and LastRaw ~= GDB_ID.NULL then
@@ -1155,10 +1170,12 @@ function NestingLib.NestPartInRawPart(LastRaw, PartList, Material, ErrorList, Is
if not IsOffline and not IsEstimate and not IsValidation then if not IsOffline and not IsEstimate and not IsValidation then
LastRaw2 = CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList, 2, LastRaw, FirstMachIndex) LastRaw2 = CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList, 2, LastRaw, FirstMachIndex)
EgtSetInfo(LastRaw, 'LastRaw2', LastRaw2) EgtSetInfo(LastRaw, 'LastRaw2', LastRaw2)
LastRaw3 = CreateMachSheets(LastMachGroupId, SheetPartId, Material, PartList, 3, LastRaw, FirstMachIndex)
EgtSetInfo(LastRaw, 'LastRaw3', LastRaw3)
end end
-- se impostata seconda macchina, reimposto la prima -- se impostata seconda macchina, reimposto la prima
local sMachName = EgtGetCurrMachineName() local sMachName = EgtGetCurrMachineName()
if sMachName == 'Multiax-NE_Nest02' then if sMachName == 'Multiax-NE_Nest02' or sMachName == 'Multiax-NE_Nest03' then
SetMachineByIndex(1) SetMachineByIndex(1)
end end
else else
@@ -1318,7 +1335,7 @@ function NestingLib.VerifyPath(Folder, BatchId, Material, MachId)
end end
end end
-- scelgo nome cartella macchina -- scelgo nome cartella macchina
if MachId == 0 or MachId == 1 or MachId == 2 then if MachId == 0 or MachId == 1 or MachId == 2 or MachId == 3 then
local MachDirName = '' local MachDirName = ''
if MachId == 0 then if MachId == 0 then
MachDirName = '##REPLACEME##' MachDirName = '##REPLACEME##'
@@ -1326,6 +1343,8 @@ function NestingLib.VerifyPath(Folder, BatchId, Material, MachId)
MachDirName = 'NE01' MachDirName = 'NE01'
elseif MachId == 2 then elseif MachId == 2 then
MachDirName = 'NE02' MachDirName = 'NE02'
elseif MachId == 3 then
MachDirName = 'NE03'
end end
CurrPath = CurrPath .. "/".. MachDirName CurrPath = CurrPath .. "/".. MachDirName
if not UtilityLib.FolderExists(CurrPath) then if not UtilityLib.FolderExists(CurrPath) then
@@ -1348,13 +1367,13 @@ function NestingLib.PostNestOp(Material, ErrorList, IsEstimate, BatchId, MachId)
local PartsPriority = {} local PartsPriority = {}
local CurrMachGroupId = EgtGetMachGroupId(Material.SheetList[Sheet].MachGroupName) local CurrMachGroupId = EgtGetMachGroupId(Material.SheetList[Sheet].MachGroupName)
-- se seconda macchina, imposto gruppo di lavorazione copia -- se seconda macchina, imposto gruppo di lavorazione copia
if MachId == 2 then if MachId == 2 or MachId == 3 then
-- recupero id grezzo originale -- recupero id grezzo originale
local nRawPartId = EgtGetFirstRawPart() local nRawPartId = EgtGetFirstRawPart()
-- cerco gruppo copia con id grezzo originale -- cerco gruppo copia con id grezzo originale
local nMachGroupId = EgtGetFirstMachGroup() local nMachGroupId = EgtGetFirstMachGroup()
while nMachGroupId do while nMachGroupId do
if EgtGetInfo(nMachGroupId, 'OrigSheetId', 'i') == CurrMachGroupId and EgtGetInfo(nMachGroupId, 'MachId', 'i') == 2 then if EgtGetInfo(nMachGroupId, 'OrigSheetId', 'i') == CurrMachGroupId and EgtGetInfo(nMachGroupId, 'MachId', 'i') == MachId then
EgtSetCurrMachGroup(nMachGroupId) EgtSetCurrMachGroup(nMachGroupId)
end end
nMachGroupId = EgtGetNextMachGroup(nMachGroupId) nMachGroupId = EgtGetNextMachGroup(nMachGroupId)
@@ -1388,7 +1407,7 @@ function NestingLib.PostNestOp(Material, ErrorList, IsEstimate, BatchId, MachId)
else else
PartsArea = CreateMachByOrderedType(Material, CurrRawPart, PartsBBox, nSkeletonLayerId, PartsPriority, ErrorList) PartsArea = CreateMachByOrderedType(Material, CurrRawPart, PartsBBox, nSkeletonLayerId, PartsPriority, ErrorList)
end end
if MachId ~= 2 then if MachId ~= 2 and MachId ~= 3 then
-- imposto area totale dei pezzi -- imposto area totale dei pezzi
Material.SheetList[Sheet].SurfaceWork = PartsArea Material.SheetList[Sheet].SurfaceWork = PartsArea
-- calcolo area esterna -- calcolo area esterna
@@ -1599,7 +1618,7 @@ function NestingLib.PostNestOp(Material, ErrorList, IsEstimate, BatchId, MachId)
EgtApplyAllMachinings() EgtApplyAllMachinings()
-- aggiorno lavorazione un'altra volta per migliorare posizioni eventuali tab -- aggiorno lavorazione un'altra volta per migliorare posizioni eventuali tab
EgtApplyAllMachinings() EgtApplyAllMachinings()
if MachId ~= 2 then if MachId ~= 2 and MachId ~= 3 then
-- ricavo stime -- ricavo stime
local CurrEstimatePath = NestingLib.VerifyPath("Estimate", BatchId, Material) local CurrEstimatePath = NestingLib.VerifyPath("Estimate", BatchId, Material)
if not UtilityLib.FolderExists(CurrEstimatePath) then if not UtilityLib.FolderExists(CurrEstimatePath) then
@@ -1632,7 +1651,7 @@ function NestingLib.PostNestOp(Material, ErrorList, IsEstimate, BatchId, MachId)
else else
CurrCNCPath = CurrCNCPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc" CurrCNCPath = CurrCNCPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc"
end end
if MachId == 2 then if MachId == 2 or MachId == 3 then
Material.SheetList[Sheet].MachiningProgram = DBCurrCNCPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc" Material.SheetList[Sheet].MachiningProgram = DBCurrCNCPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc"
else else
Material.SheetList[Sheet].MachiningProgram = CurrCNCPath Material.SheetList[Sheet].MachiningProgram = CurrCNCPath
@@ -1651,7 +1670,7 @@ function NestingLib.PostNestOp(Material, ErrorList, IsEstimate, BatchId, MachId)
EgtCreateDirectory(CurrPrintPath) EgtCreateDirectory(CurrPrintPath)
end end
CurrPrintPath = CurrPrintPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc" CurrPrintPath = CurrPrintPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc"
if MachId == 2 then if MachId == 2 or MachId == 3 then
Material.SheetList[Sheet].PrintProgram = DBCurrPrintPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc" Material.SheetList[Sheet].PrintProgram = DBCurrPrintPath .. "/" .. Material.SheetList[Sheet].MachGroupName .. ".cnc"
else else
Material.SheetList[Sheet].PrintProgram = CurrPrintPath Material.SheetList[Sheet].PrintProgram = CurrPrintPath
@@ -1659,7 +1678,7 @@ function NestingLib.PostNestOp(Material, ErrorList, IsEstimate, BatchId, MachId)
bOk = EgtCopyFile(CurrPrintCNCPath, CurrPrintPath) bOk = EgtCopyFile(CurrPrintCNCPath, CurrPrintPath)
bOk = EgtEraseFile(CurrPrintCNCPath) bOk = EgtEraseFile(CurrPrintCNCPath)
end end
if MachId ~= 2 then if MachId ~= 2 and MachId ~= 3 then
-- salvo svg del grezzo -- salvo svg del grezzo
local CurrSVGPath = NestingLib.VerifyPath("SVG", BatchId, Material) local CurrSVGPath = NestingLib.VerifyPath("SVG", BatchId, Material)
if not UtilityLib.FolderExists(CurrSVGPath) then if not UtilityLib.FolderExists(CurrSVGPath) then
@@ -1747,10 +1766,12 @@ end
end end
-- scrittura delle linee modificate -- scrittura delle linee modificate
local fh2 = io.open( LabelSVGPath, 'w') local fh2 = io.open( LabelSVGPath, 'w')
for i = 1, #Lines do if fh2 then
fh2:write( Lines[i] .. '\n') for i = 1, #Lines do
fh2:write( Lines[i] .. '\n')
end
fh2:close()
end end
fh2:close()
-- fine -- fine
end end
@@ -1841,7 +1862,7 @@ function CreateMachByType(Material, CurrRawPart, PartsBBox, nSkeletonLayerId, Pa
EgtSetName(CutPartsArea, PARTCUTSUM) EgtSetName(CutPartsArea, PARTCUTSUM)
else else
if not nPartSurfId then if not nPartSurfId then
x = 2 local x = 2
end end
EgtSurfFrAdd(CutPartsArea, nPartSurfId) EgtSurfFrAdd(CutPartsArea, nPartSurfId)
end end
@@ -2433,6 +2454,7 @@ function CalcPartMachinings(Material, CurrPart, bInternalPart, LastMch, nMachTyp
EgtSetMachiningParam(MCH_MP.OFFSR, dRadial) EgtSetMachiningParam(MCH_MP.OFFSR, dRadial)
EgtSetMachiningParam(MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam(MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- applico la lavorazione -- applico la lavorazione
local bValidOutlineMach = false
if EgtApplyMachining() then if EgtApplyMachining() then
bValidOutlineMach = true bValidOutlineMach = true
InitInTSP(NewMachId, InternalOutlineList, 0) InitInTSP(NewMachId, InternalOutlineList, 0)
@@ -2479,6 +2501,7 @@ function CalcPartMachinings(Material, CurrPart, bInternalPart, LastMch, nMachTyp
EgtSetMachiningParam(MCH_MP.OFFSR, dRadial) EgtSetMachiningParam(MCH_MP.OFFSR, dRadial)
EgtSetMachiningParam(MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) EgtSetMachiningParam(MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
-- applico la lavorazione -- applico la lavorazione
local bValidOutlineMach = false
if EgtApplyMachining() then if EgtApplyMachining() then
bValidOutlineMach = true bValidOutlineMach = true
InitInTSP(NewMachId, InternalOutlineList, 0) InitInTSP(NewMachId, InternalOutlineList, 0)
@@ -2526,6 +2549,7 @@ function CalcPartMachinings(Material, CurrPart, bInternalPart, LastMch, nMachTyp
EgtSetMachiningParam(MCH_MP.OFFSR, dRadial) EgtSetMachiningParam(MCH_MP.OFFSR, dRadial)
EgtSetMachiningParam(MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT) EgtSetMachiningParam(MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
-- applico la lavorazione -- applico la lavorazione
local bValidOutlineMach = false
if EgtApplyMachining() then if EgtApplyMachining() then
bValidOutlineMach = true bValidOutlineMach = true
InitInTSP(NewMachId, InternalOutlineList, 0) InitInTSP(NewMachId, InternalOutlineList, 0)
@@ -2679,8 +2703,8 @@ function NestingLib.ManageMachine(CurrIsOffline)
table.insert(OutlineMachining, 2, Config.NWOutlineMachTools) table.insert(OutlineMachining, 2, Config.NWOutlineMachTools)
table.insert(HoleMachining, 2, Config.NWHoleMachTools) table.insert(HoleMachining, 2, Config.NWHoleMachTools)
table.insert(RampMachining, 2, Config.NWRampMachTools[1]) table.insert(RampMachining, 2, Config.NWRampMachTools[1])
table.insert(CountersinkMachining, 2, Config.NWCountersinkMachTools) table.insert(CountersinkMachining, 2, Config.NWCountersinkMachTools[1])
table.insert(OutsideChamferMachining, 2, Config.MXOutsideChamferMachTools) table.insert(OutsideChamferMachining, 2, Config.MXOutsideChamferMachTools[1])
table.insert(InsideChamferMachining, 2, Config.NWInsideChamferMachTools[1]) table.insert(InsideChamferMachining, 2, Config.NWInsideChamferMachTools[1])
Pocketing = Config.NWPocketingTools Pocketing = Config.NWPocketingTools
IsOffline = true IsOffline = true