DataBeam :

- primo rilascio.
This commit is contained in:
Dario Sassi
2019-04-01 15:18:51 +00:00
parent ab6345a4ba
commit 6eaba8a577
51 changed files with 7856 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
-- Swap.lua by Egaltech s.r.l. 2017/11/02
-- Gestione scambio testa coda di una Trave
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- recupero il pezzo del primo oggetto selezionato
local nId = EgtGetFirstSelectedObj()
local nPartId = EgtGetParent( EgtGetParent( nId or GDB_ID.NULL) or GDB_ID.NULL)
if not nPartId or not EgtIsPart( nPartId) then
EgtOutBox( 'Nessuna trave selezionata', 'Swap Trave', 'ERROR')
return
end
-- recupero il box del pezzo
local Ls = EgtGetFirstNameInGroup( nPartId, 'Box')
local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD)
if not b3Solid then
local sName = EgtGetName( nPartId) or ( 'Id=' .. tonumber( nPartId))
EgtOutBox( 'Box non definito per la trave ' .. sName, 'Swap Trave', 'ERROR')
return
end
-- eseguo rotazione di 180 gradi attorno asse Z
EgtRotate( nPartId, b3Solid:getCenter(), Z_AX(), 180, GDB_RT.GLOB)
EgtDraw()
-- end