-- DisableFeatures.lua by Egaltech s.r.l. 2019/11/22 -- 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 -- verifico sia una feature local nParentId = EgtGetParent( nId) if EgtIsLayer( nParentId or GDB_ID.NULL) and EgtGetName( nParentId) == 'Processings' and EgtGetInfo( nId, 'GRP', 'i') and EgtGetInfo( nId, 'PRC', 'i') then EgtRemoveInfo( nId, 'DO') EgtResetColor( nId) local nAuxId = EgtGetInfo( nId, 'AUXID', 'i') if nAuxId then EgtResetColor( nId + nAuxId) end table.insert( vParts, EgtGetParent( nParentId)) end nId = EgtGetNextSelectedObj() end -- Cancello eventuale solido dei pezzi interessati table.sort( vParts) local PrevPartId = GDB_ID.NULL for i = 1, #vParts do if vParts[i] ~= PrevPartId then local SolidLy = EgtGetFirstNameInGroup( vParts[i], 'Solid') EgtErase( SolidLy or GDB_ID.NULL) PrevPartId = vParts[i] end end EgtDeselectAll() EgtZoom( SCE_ZM.ALL) -- end