068124cd30
- modficata l'analisi e il recupero delle linee di sincronizzazione.
43 lines
1.6 KiB
Lua
43 lines
1.6 KiB
Lua
-- ResetSyncLines.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_EDIT_SYNC_CURVES = 'Error in Edit Sync Curves : '
|
|
|
|
-- Recupero il Part e Layer di Trimming corrente ( o di riferimento)
|
|
local nCurrPartId = EgtGetCurrPart()
|
|
local nCurrLayerId = GlobVar.GetTrimmingLayerRefId( EgtGetCurrLayer())
|
|
if not GlobVar.IsTrimmingLayer( nCurrLayerId) then
|
|
EgtOutBox( ERROR_EDIT_SYNC_CURVES .. 'Not a valid Trimming Layer', 'Error', 'ERROR', 'OK')
|
|
return
|
|
end
|
|
|
|
-- Recupero il Layer di Edit e di Store delle Curve di Sync
|
|
local nLayerEditId = GlobVar.GetCurrentEditSyncCurvesLayer( nCurrPartId)
|
|
local nLayerStoreId = GlobVar.GetCurrentStoredCurvesLayer( nCurrPartId)
|
|
if ( not nLayerEditId or nLayerEditId == GDB_ID.NULL) and ( not nLayerStoreId or nLayerStoreId == GDB_ID.NULL) then
|
|
EgtOutBox( ERROR_EDIT_SYNC_CURVES .. 'Not a valid Edit mode created', 'Error', 'ERROR', 'OK')
|
|
return
|
|
end
|
|
|
|
-- Chiedo Conferma dell'Operazione
|
|
local bDelete = EgtOutBox( 'Do you want erase all the Sync Lines ?', 'Confirm', 'QUESTION', 'YESNO')
|
|
if not bDelete then EgtSetCurrPartLayer( nCurrPartId, nLayerEditId) return end
|
|
|
|
-- Cancello ( se esistono) i rispettivi Gruppi
|
|
if nLayerEditId then EgtErase( nLayerEditId) end
|
|
if nLayerStoreId then EgtErase( nLayerStoreId) end
|
|
|
|
-- Metto il Focus sul Layer di Trimming
|
|
EgtSetStatus( nCurrLayerId, GDB_ST.ON)
|
|
EgtSetCurrPartLayer( nCurrPartId, nCurrLayerId)
|
|
|
|
-- Aggiorno la Grafica
|
|
EgtDraw()
|