Files
trimming/ResetSyncLines.lua
T
Riccardo Elitropi 5dd7acad75 Trimming 3.1a1 :
- Primo Commit
2026-01-19 11:31:08 +01:00

39 lines
1.4 KiB
Lua

-- ResetSyncLines.lua by Egalware s.r.l. 2026/01/05
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( true)
-- 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
-- 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()