Files
saomad-kairos-mk2/Scripts/InitMach.lua
T
2024-06-27 12:46:19 +02:00

45 lines
1.1 KiB
Lua

-- 2023/09/22 13:00:00
-- Machining Init for Saomad-KAIROS machine
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
--------------------------------------------------------------------------------
-- *** Ingresso in Lavorazioni ***
-- Rendo visibile il pezzo e le geometrie aggiunte, nascondo il Box
local function ProcessPart( PartId)
-- nascondo il Box
EgtSetStatus( EgtGetFirstNameInGroup( PartId, 'Box') or GDB_ID.NULL, GDB_ST.OFF)
end
-- Disabilito segnalazione modifica progetto
local bEnMod = EgtGetEnableModified()
EgtDisableModified()
-- Processo i pezzi nella radice
local PartId = EgtGetFirstPart()
while PartId do
ProcessPart( PartId)
PartId = EgtGetNextPart( PartId)
end
-- Processo i pezzi già nei gruppi di lavoro (quando appena lanciata Process)
local GhostId = EgtGetFirstGhostPart()
while GhostId do
local PartId = EgtGetInfo( GhostId, GDB_SI.SOURCE, 'i')
if PartId then
ProcessPart( PartId)
end
GhostId = EgtGetNextGhostPart( GhostId)
end
-- Ripristino segnalazione modifica progetto
if bEnMod then
EgtEnableModified()
end
MACH.ERR = 0