Files
trimming/ResetBezierSurf.lua
T
Daniele Bariletti 551dd86eaa Trimming 3.1h2 :
- spostate le costanti in EgtConst nella tabella MCH_TRIMMING.
2026-08-26 12:12:39 +02:00

36 lines
1.2 KiB
Lua

-- CalcBezier.lua by Egalware s.r.l. 2026/01/22
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Carico le costanti di Trimming
EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
local GlobVar = require( 'TrimmingLib')
-- Costante di Errore
local ERROR_BEZIER_CREATION = 'Error in Ruled Bezier Creation : '
-- Recupero il Part e il Layer di Trimming con le relative Info
local nCurrPartId = EgtGetCurrPart()
local nCurrLayerId = GlobVar.GetTrimmingLayerRefId( EgtGetCurrLayer())
if not GlobVar.IsTrimmingLayer( nCurrLayerId) then
EgtOutBox( ERROR_BEZIER_CREATION .. 'Not a valid Trimming Layer', 'Error', 'ERROR', 'OK')
return
end
-- Chiedo Conferma dell'Operazione
local bDelete = EgtOutBox( 'Do you want erase the Bezier Surface ?', 'Confirm', 'QUESTION', 'YESNO')
if not bDelete then EgtSetCurrPartLayer( nCurrPartId, nCurrLayerId) return end
-- Rimuovo tutte le entità che sono Superfici di Bezier Ruled nel Layer corrente
local vIdToErase = {}
local nId = EgtGetFirstInGroup( nCurrLayerId)
while nId do
local sName = EgtGetName( nId)
if sName == MCH_TRIMMING.RULED_BZ_NAME then table.insert( vIdToErase, nId) end
nId = EgtGetNext( nId)
end
EgtErase( vIdToErase)
-- Aggiorno la Grafica
EgtDraw()