diff --git a/LuaLibs/CalcSlices.lua b/LuaLibs/CalcSlices.lua index 95561d4..2be81dd 100644 --- a/LuaLibs/CalcSlices.lua +++ b/LuaLibs/CalcSlices.lua @@ -72,7 +72,7 @@ function CalcSlices.Exec( nPartId, nStmId, HMax) local dDeltaZStart = 0.2 local vZSlices = ComputeZSlices( dZmin, dDeltaZStart, dZmax) local nLayId = EgtParPlanesSurfTmInters( ORIG(), Z_AX(), vZSlices, nStmId, nPartId, GDB_RT.GLOB, TOLER) - + local vErr = {} -- scorro i risultati dello slicing while nLayId do @@ -206,12 +206,18 @@ function CalcSlices.Exec( nPartId, nStmId, HMax) else -- errore EgtSetName( nLayId, '__' .. SLICE_LAYER .. EgtNumToString( nLayCnt)) + table.insert( vErr, nLayCnt) end -- passo al layer successivo nLayCnt = nLayCnt + 1 nLayId = EgtGetNext( nLayId) end + + -- eventuale segnalazione errori + if #vErr > 0 then + EgtOutBox( 'Slicing Error on layers :\n' .. table.concat( vErr, ','), 'SlicingCalc') + end end --------------------------------------------------------------------- diff --git a/LuaLibs/RunShowManager.lua b/LuaLibs/RunShowManager.lua index e8cf80d..37e95ca 100644 --- a/LuaLibs/RunShowManager.lua +++ b/LuaLibs/RunShowManager.lua @@ -66,7 +66,7 @@ function RunShowManager.Exec() end -- ciclo sui layer per dis/attivare il resto local nLayerIndex = 1 - local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) + local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex) while nLayerId do local nCrvId = EgtGetFirstGroupInGroup( nLayerId) while nCrvId do @@ -89,7 +89,7 @@ function RunShowManager.Exec() nCrvId = EgtGetNext( nCrvId) end nLayerIndex = nLayerIndex + 1 - nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) + nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex) end nPartIndex = nPartIndex + 1 nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) diff --git a/LuaLibs/RunSliceAdvancement.lua b/LuaLibs/RunSliceAdvancement.lua index 1970c43..daceaf5 100644 --- a/LuaLibs/RunSliceAdvancement.lua +++ b/LuaLibs/RunSliceAdvancement.lua @@ -30,7 +30,7 @@ function RunSliceAdvancement.Exec() EgtOutBox( 'No sliced part in this project!', 'Error', 'ERROR') return else - local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. 1) + local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. 1) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. 1) if not nLayerId then EgtOutBox( 'No sliced part in this project!', 'Error', 'ERROR') return @@ -77,7 +77,7 @@ function RunSliceAdvancement.Exec() while nPartId do -- ciclo sui layer per dis/attivare il resto local nLayerIndex = 1 - local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) + local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex) while nLayerId do local nCrvId = EgtGetFirstGroupInGroup( nLayerId) while nCrvId do @@ -129,7 +129,7 @@ function RunSliceAdvancement.Exec() nCrvId = EgtGetNext( nCrvId) end nLayerIndex = nLayerIndex + 1 - nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) + nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex) end nPartIndex = nPartIndex + 1 nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) diff --git a/LuaLibs/RunViewManager.lua b/LuaLibs/RunViewManager.lua index cf60dff..516139d 100644 --- a/LuaLibs/RunViewManager.lua +++ b/LuaLibs/RunViewManager.lua @@ -71,7 +71,7 @@ function RunViewManager.Exec() local nSelLayerId = EgtGetLastSelectedObj() while nSelLayerId do local sSelLayerName = EgtGetName( nSelLayerId) - if sSelLayerName and sSelLayerName:sub(1, 5) == SLICE_LAYER then + if sSelLayerName and ( sSelLayerName:sub(1, 5) == SLICE_LAYER or sSelLayerName:sub(3, 7) == SLICE_LAYER) then bFound = true break end @@ -93,11 +93,11 @@ function RunViewManager.Exec() -- ciclo sui pezzi local nPartIndex = 1 - local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) + local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex) while nPartId do -- ciclo sui layer per dis/attivare il resto local nLayerIndex = 1 - local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) + local nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex) while nLayerId do if nVisibilityMode == LAYER_VIEW_TYPE.ALL then EgtSetStatus( nLayerId, GDB_ST.ON) @@ -132,7 +132,7 @@ function RunViewManager.Exec() nCrvId = EgtGetNext( nCrvId) end nLayerIndex = nLayerIndex + 1 - nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) + nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex) end nPartIndex = nPartIndex + 1 nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. nPartIndex)