Files
DataBeamWall/DisableFeatures.lua
Dario Sassi eaf4d0e5c8 DataBeamWall :
- modificati script di abilitazione/disabilitazione feature per usare nuove funzioni 2.3a1.
2021-01-02 10:09:06 +00:00

39 lines
932 B
Lua

-- DisableFeatures.lua by Egaltech s.r.l. 2020/12/31
-- Gestione disabilitazione delle feature selezionate
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
if EgtGetSelectedObjCount() == 0 then
EgtOutBox( 'Nessuna lavorazione selezionata', 'Disabilita lavorazioni', 'ERROR')
end
-- Elenco dei pezzi interessati
local vParts = {}
-- Disabilito features selezionate
local nId = EgtGetFirstSelectedObj()
while nId do
if EgtBeamEnableProcess( nId, false, 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