diff --git a/DisableFeatures.lua b/DisableFeatures.lua index cb5c4b2..0888eb0 100644 --- a/DisableFeatures.lua +++ b/DisableFeatures.lua @@ -1,4 +1,4 @@ --- DisableFeatures.lua by Egaltech s.r.l. 2020/07/27 +-- DisableFeatures.lua by Egaltech s.r.l. 2020/12/31 -- Gestione disabilitazione delle feature selezionate -- Intestazioni @@ -16,29 +16,19 @@ local vParts = {} -- Disabilito 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' or EgtGetName( nParentId) == 'Outline') and - EgtGetInfo( nId, 'GRP', 'i') and EgtGetInfo( nId, 'PRC', 'i') then - EgtSetInfo( nId, 'DO', 0) - EgtSetColor( nId, Color3d( 160, 160, 160)) - local nAuxId = EgtGetInfo( nId, 'AUXID', 'i') - if nAuxId then - EgtSetColor( nId + nAuxId, Color3d( 160, 160, 160)) - end - table.insert( vParts, EgtGetParent( nParentId)) + if EgtBeamEnableProcess( nId, false, false) then + table.insert( vParts, EgtGetParent( EgtGetParent( nId))) end nId = EgtGetNextSelectedObj() end --- Cancello eventuale solido dei pezzi interessati +-- Forzo aggiornamento dei pezzi 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) + EgtBeamSetPart( vParts[i]) + EgtBeamUpdatePart() PrevPartId = vParts[i] end end diff --git a/EnableFeatures.lua b/EnableFeatures.lua index bd73193..330f299 100644 --- a/EnableFeatures.lua +++ b/EnableFeatures.lua @@ -1,4 +1,4 @@ --- DisableFeatures.lua by Egaltech s.r.l. 2020/07/27 +-- DisableFeatures.lua by Egaltech s.r.l. 2020/12/31 -- Gestione abilitazione delle feature selezionate -- Intestazioni @@ -16,37 +16,19 @@ 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' or EgtGetName( nParentId) == 'Outline') and - EgtGetInfo( nId, 'GRP', 'i') and EgtGetInfo( nId, 'PRC', 'i') then - EgtRemoveInfo( nId, 'DO') - if EgtGetName( nParentId) == 'Processings' then - EgtResetColor( nId) - else - EgtSetColor( nId, Color3d( 80, 160, 160)) - end - local nAuxId = EgtGetInfo( nId, 'AUXID', 'i') - if nAuxId then - if EgtGetName( nParentId) == 'Processings' then - EgtResetColor( nId + nAuxId) - else - EgtSetColor( nId + nAuxId, Color3d( 80, 160, 160)) - end - end - table.insert( vParts, EgtGetParent( nParentId)) + if EgtBeamEnableProcess( nId, true, false) then + table.insert( vParts, EgtGetParent( EgtGetParent( nId))) end nId = EgtGetNextSelectedObj() end --- Cancello eventuale solido dei pezzi interessati +-- Forzo aggiornamento dei pezzi 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) + EgtBeamSetPart( vParts[i]) + EgtBeamUpdatePart() PrevPartId = vParts[i] end end