Trimming 3.1a1 :
- Primo Commit
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
-- DeleteTrimming.lua by Egalware s.r.l. 2026/01/05
|
||||
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
|
||||
-- Carico le costanti di Trimming
|
||||
EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
|
||||
local GlobVar = require( 'TrimmingLib')
|
||||
-- Costante di Errore
|
||||
local ERROR_DELETING_TRIMMING = 'Error in Deleting New Trimming : '
|
||||
|
||||
-- Chiedo all'Utente la conferma per eliminare il Layer di Trimming corrente ed eventuali gruppi temporanei
|
||||
local bDelete = EgtOutBox( 'Do you want to delete the current Trimming machining ?', 'Deleting', 'QUESTION', 'YESNO')
|
||||
if not bDelete then return end
|
||||
|
||||
-- Recupero il Part e il Layer corrente di Trimming
|
||||
local nCurrPartId = EgtGetCurrPart()
|
||||
local nCurrLayerId = EgtGetCurrLayer()
|
||||
|
||||
local nTrimmingLayerId = nil
|
||||
-- Se il Layer corrente è di Trimming, memorizzo il suo Id
|
||||
if GlobVar.IsTrimmingLayer( nCurrLayerId) then nTrimmingLayerId = nCurrLayerId
|
||||
-- Se invece è un altro Layer, recupero il Layer di Trimmatura a cui si riferisce
|
||||
else nTrimmingLayerId = GlobVar.GetTrimmingLayerRefId( nCurrLayerId) end
|
||||
if nTrimmingLayerId == nil or nTrimmingLayerId == GDB_ID.NULL then
|
||||
EgtOutBox( ERROR_DELETING_TRIMMING.. 'No Trimming Machinining Layer Found', 'Error', 'ERROR', 'OK')
|
||||
return
|
||||
end
|
||||
|
||||
-- Recupero tutti i layer di Edit e di Stored associati a tale Layer di Trimmatura
|
||||
local vLayerIdToErase = GlobVar.GetAllEditOrStoredLayer( nCurrPartId, nTrimmingLayerId)
|
||||
|
||||
-- Elimino tutti i Layer ricavati
|
||||
EgtErase( nTrimmingLayerId)
|
||||
EgtErase( vLayerIdToErase)
|
||||
|
||||
-- Aggiorno la Grafica
|
||||
EgtDraw()
|
||||
Reference in New Issue
Block a user