DataBeam :

- aggiunto calcolo del solido della trave tramite operatori booleani su Stm.
This commit is contained in:
Dario Sassi
2019-11-23 17:53:31 +00:00
parent 309be3d7a7
commit 8ce7008a76
5 changed files with 103 additions and 5 deletions
+2 -1
View File
@@ -11,4 +11,5 @@ Button6=EnableFeatures.lua,Images\EnableFeatures.png,Abilita lavorazioni
Button7=BeamMachinings,Images\BeamMachinings.png,Lista lavorazioni
Button8=HideAll.lua,Images\HideAll.png,Nascondi tutte le travi non selezionate
Button9=ShowAll.lua,Images\ShowAll.png,Visualizza tutte le travi
Button10=ShowBuilding.lua,Images\ShowBuilding.png,Visualizza struttura/Visualizza pezzi
Button10=ShowSolid.lua,Images\ShowSolid.png,Visualizza/Nascondi solido
Button11=ShowBuilding.lua,Images\ShowBuilding.png,Visualizza struttura/Visualizza pezzi
+18 -2
View File
@@ -1,4 +1,4 @@
-- DisableFeatures.lua by Egaltech s.r.l. 2018/04/25
-- DisableFeatures.lua by Egaltech s.r.l. 2019/11/22
-- Gestione disabilitazione delle feature selezionate
-- Intestazioni
@@ -10,11 +10,15 @@ 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
-- verifico sia una feature
local nParentId = EgtGetParent( nId)
if EgtIsLayer( nParentId) and EgtGetName( nParentId) == 'Processings' and
if EgtIsLayer( nParentId or GDB_ID.NULL) and EgtGetName( nParentId) == 'Processings' and
EgtGetInfo( nId, 'GRP', 'i') and EgtGetInfo( nId, 'PRC', 'i') then
EgtSetInfo( nId, 'DO', 0)
EgtSetColor( nId, Color3d( 160, 160, 160))
@@ -22,10 +26,22 @@ while nId do
if nAuxId then
EgtSetColor( nId + nAuxId, Color3d( 160, 160, 160))
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)
+18 -2
View File
@@ -1,4 +1,4 @@
-- DisableFeatures.lua by Egaltech s.r.l. 2018/04/25
-- DisableFeatures.lua by Egaltech s.r.l. 2019/11/22
-- Gestione abilitazione delle feature selezionate
-- Intestazioni
@@ -10,11 +10,15 @@ 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) and EgtGetName( nParentId) == 'Processings' and
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)
@@ -22,10 +26,22 @@ while nId do
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)
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+65
View File
@@ -0,0 +1,65 @@
-- ShowSolid.lua by Egaltech s.r.l. 2019/11/22
-- Gestione calcolo solido di una Trave
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
-- Funzione per visualizzazione del solido o standard
local function Show( PartId, bSolid)
local BoxLy = EgtGetFirstNameInGroup( PartId, 'Box')
EgtSetStatus( BoxLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.OFF, GDB_ST.ON))
local OutlineLy = EgtGetFirstNameInGroup( PartId, 'Outline')
EgtSetStatus( OutlineLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.OFF, GDB_ST.ON))
local ProcessingsLy = EgtGetFirstNameInGroup( PartId, 'Processings')
EgtSetStatus( ProcessingsLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.OFF, GDB_ST.ON))
local SolidLy = EgtGetFirstNameInGroup( PartId, 'Solid')
EgtSetStatus( SolidLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.ON, GDB_ST.OFF))
end
-- Recupero il pezzo del primo oggetto selezionato
local ObjId = EgtGetFirstSelectedObj()
local PartId = EgtGetParent( EgtGetParent( ObjId or GDB_ID.NULL) or GDB_ID.NULL)
if not PartId or not EgtIsPart( PartId) then
EgtOutBox( 'Nessuna trave selezionata', 'Show Solid', 'ERROR')
return
end
EgtDeselectAll()
-- Recupero il Box
local BoxLy = EgtGetFirstNameInGroup( PartId, 'Box')
local BoxId = EgtGetFirstNameInGroup( BoxLy or GDB_ID.NULL, 'Box')
if not BoxId then
EgtOutBox( 'Trave senza Box', 'Show Solid', 'ERROR')
return
end
-- Verifico esistenza del solido
local SolidLy = EgtGetFirstNameInGroup( PartId, 'Solid')
if not SolidLy then
SolidLy = EgtGroup( PartId)
EgtSetName( SolidLy, 'Solid')
end
local SolidId = EgtGetFirstNameInGroup( SolidLy, 'Solid')
if not SolidId then
SolidId = EgtCopyGlob( BoxId, SolidLy)
EgtSetName( SolidId, 'Solid')
EgtSetAlpha( SolidId, 100)
Show( PartId, true)
else
Show( PartId, ( EgtGetStatus( SolidLy) == GDB_ST.OFF))
EgtDraw()
return
end
-- Ciclo sulle features
local ProcLy = EgtGetFirstNameInGroup( PartId, 'Processings')
local ProcId = EgtGetFirstInGroup( ProcLy)
while ProcId do
if EgtGetInfo( ProcId, 'DO', 'i') ~= 0 and EgtGetType( ProcId) == GDB_TY.SRF_MESH then
EgtSurfTmIntersect( SolidId, ProcId)
end
ProcId = EgtGetNext( ProcId)
end
EgtDraw()