Files
Carlo Baronchelli 741791a0e4 Copia locale Iniziale
2022-05-19 16:04:07 +02:00

39 lines
884 B
Lua

-- DisableFeatures.lua by Egaltech s.r.l. 2020/12/31
-- Gestione abilitazione delle feature selezionate
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
if EgtGetSelectedObjCount() == 0 then
EgtOutBox( 'Nessuna lavorazione selezionata', 'Abilita lavorazioni', 'ERROR')
end
-- Elenco dei pezzi interessati
local vParts = {}
-- Abilito features selezionate
local nId = EgtGetFirstSelectedObj()
while nId do
if EgtBeamEnableProcess( nId, true, false) then
table.insert( vParts, EgtGetParent( EgtGetParent( nId)))
end
nId = EgtGetNextSelectedObj()
end
-- Forzo aggiornamento dei pezzi
table.sort( vParts)
local PrevPartId = GDB_ID.NULL
for i = 1, #vParts do
if vParts[i] ~= PrevPartId then
EgtBeamSetPart( vParts[i])
EgtBeamUpdatePart()
PrevPartId = vParts[i]
end
end
EgtDeselectAll()
EgtDraw()
-- end