dfa187838b
- aggiunta memorizzazione dell'ulltimo tipo selezionato nella modalità selezione - se le superfici di selezione generano più di 2 curve di bordo allora vengono definiti degli altri layer di trimming - semplificazione gestione dei layer di sincronizzazione delle curve - aggiunta funzionalità di rimozione delle superfici di Bezier in un layer di trimmatura - miglioramento nella selezione delle curve di sincronizzazione nel caso di curve di bordo chiuse o aperte.
41 lines
1.4 KiB
Lua
41 lines
1.4 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
|
|
local nLayerEditId = GlobVar.GetCurrentEditSyncCurvesLayer( nCurrPartId, nCurrLayerId)
|
|
if ( not nLayerEditId or nLayerEditId == 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
|
|
|
|
-- Metto il Focus sul Layer di Trimming
|
|
EgtSetStatus( nCurrLayerId, GDB_ST.ON)
|
|
EgtSetCurrPartLayer( nCurrPartId, nCurrLayerId)
|
|
|
|
-- Aggiorno la Grafica
|
|
EgtDraw()
|