Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 77a3681439 | |||
| d568808608 | |||
| 01cdf7396c | |||
| 355b375f47 | |||
| b5fe2461bc | |||
| be4ce0b4b0 | |||
| 90e1ea7f93 | |||
| beaad06ecc | |||
| ce7a88cb40 | |||
| 39fbe01684 | |||
| 69e0dca89e | |||
| eda6cde853 |
+4
-7
@@ -13,12 +13,9 @@
|
||||
/Debug64
|
||||
/Release64
|
||||
/ipch
|
||||
/bin
|
||||
/obj
|
||||
/.vs
|
||||
/32/*.lua
|
||||
/32/LuaLibs/*.lua
|
||||
/32/Images/*.png
|
||||
/64/*.lua
|
||||
/64/LuaLibs/*.lua
|
||||
/64/Images/*.png
|
||||
/bin/*.lua
|
||||
/bin/*.ini
|
||||
/bin/LuaLibs/*.lua
|
||||
/bin/Images/*.png
|
||||
|
||||
+2
-12
@@ -27,15 +27,6 @@ variables:
|
||||
lua54 -o bin\$FileName $FileName
|
||||
echo "lua54 -o bin\$FileName $FileName"
|
||||
}
|
||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||
ForEach ($File in $FileList) {
|
||||
$FileName = Split-Path $File -leaf
|
||||
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
|
||||
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||
}
|
||||
|
||||
# Copy-Item -Path $FileName -Destination 64\$FileName
|
||||
# echo "Copy-Item -Path $FileName -Destination 64\$FileName"
|
||||
# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI
|
||||
.CodeReplicaR: &CodeReplicaR
|
||||
- |
|
||||
@@ -46,7 +37,7 @@ variables:
|
||||
SLEEP 2
|
||||
net use X: /delete
|
||||
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle bin
|
||||
.ReplicaR: &ReplicaR
|
||||
- |
|
||||
net use X: /delete
|
||||
@@ -57,7 +48,7 @@ variables:
|
||||
SLEEP 2
|
||||
net use X: /delete
|
||||
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle 32 e 64
|
||||
# helper copia script verso cartella di rete R:\ delle cartelle bin
|
||||
.ReplicaZ: &ReplicaZ
|
||||
- |
|
||||
net use Z: /delete
|
||||
@@ -83,4 +74,3 @@ LuaCompile:build:
|
||||
- *CodeReplicaR
|
||||
- *ReplicaR
|
||||
- *ReplicaZ
|
||||
|
||||
|
||||
+7
-6
@@ -2,9 +2,10 @@
|
||||
BtlEnable=1
|
||||
BaseDir=C:\EgtData\BeamWall
|
||||
Button1=ClearProcess.lua,Images\ClearProcess.png,Cancella Lavorazioni Pezzo
|
||||
Button2=DisableFeatures.lua,Images\DisableFeatures.png,Disabilita Lavorazioni
|
||||
Button3=EnableFeatures.lua,Images\EnableFeatures.png,Abilita Lavorazioni
|
||||
Button4=HideAll.lua,Images\HideAll.png,Nascondi i Pezzi non selezionati
|
||||
Button5=ShowAll.lua,Images\ShowAll.png,Visualizza tutti i Pezzi
|
||||
Button6=ShowSolid.lua,Images\ShowSolid.png,Visualizza/Nascondi Solido
|
||||
Button7=ShowBuilding.lua,Images\ShowBuilding.png,Visualizza Struttura/Visualizza Pezzi
|
||||
Button2=SolidProcess.lua,Images\SolidProcess.png,Trasforma Solidi in Pezzi
|
||||
Button3=DisableFeatures.lua,Images\DisableFeatures.png,Disabilita Lavorazioni
|
||||
Button4=EnableFeatures.lua,Images\EnableFeatures.png,Abilita Lavorazioni
|
||||
Button5=HideAll.lua,Images\HideAll.png,Nascondi i Pezzi non selezionati
|
||||
Button6=ShowAll.lua,Images\ShowAll.png,Visualizza tutti i Pezzi
|
||||
Button7=ShowSolid.lua,Images\ShowSolid.png,Visualizza/Nascondi Solido
|
||||
Button8=ShowBuilding.lua,Images\ShowBuilding.png,Visualizza Struttura/Visualizza Pezzi
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
|
||||
REM Compilazione degli script BeamWall Egaltech 2024.12.30
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 e 64 bit
|
||||
|
||||
erase bin\*.lua
|
||||
|
||||
\EgtProg\Dll32\luac54 -o bin\ClearProcess.lua ClearProcess.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\DisableFeatures.lua DisableFeatures.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\EnableFeatures.lua EnableFeatures.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\HideAll.lua HideAll.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\ShowAll.lua ShowAll.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\ShowBuilding.lua ShowBuilding.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\ShowSolid.lua ShowSolid.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\SolidProcess.lua SolidProcess.lua
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
+53
-20
@@ -1,4 +1,4 @@
|
||||
-- ShowSolid.lua by Egaltech s.r.l. 2020/12/12
|
||||
-- ShowSolid.lua by Egaltech s.r.l. 2024/05/01
|
||||
-- Gestione calcolo solido di una Trave
|
||||
|
||||
require( 'EgtBase')
|
||||
@@ -6,26 +6,59 @@ _ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
|
||||
|
||||
-- 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()
|
||||
|
||||
-- Se il solido già esiste, ne aggiorno lo stato di visualizzazione
|
||||
local SolidId = EgtBeamGetSolid( PartId)
|
||||
if SolidId and EgtGetInfo( SolidId, 'VALID') then
|
||||
EgtBeamShowSolid( PartId, ( EgtGetCalcStatus( SolidId) == GDB_ST.OFF))
|
||||
-- Se premuto Shift devo processare tutti i pezzi del progetto
|
||||
if EgtGetKeyPressed( GEN_VK.SHIFT) then
|
||||
local nPartTot = EgtGetPartCount()
|
||||
local nPartCnt = 0
|
||||
local bShow
|
||||
local PartId = EgtGetFirstPart()
|
||||
while PartId do
|
||||
-- recupero l'eventuale solido del pezzo
|
||||
local SolidId = EgtBeamGetSolid( PartId)
|
||||
-- se primo pezzo, recupero lo stato
|
||||
if bShow == nil then
|
||||
if SolidId and EgtGetInfo( SolidId, 'VALID') and EgtGetCalcStatus( SolidId) ~= GDB_ST.OFF then
|
||||
bShow = false
|
||||
else
|
||||
bShow = true
|
||||
end
|
||||
end
|
||||
-- se da visualizzazione e necessario eseguo eventuale calcolo
|
||||
if bShow and ( not SolidId or not EgtGetInfo( SolidId, 'VALID')) then
|
||||
EgtBeamCalcSolid( PartId, true)
|
||||
end
|
||||
-- aggiorno visualizzazione
|
||||
EgtBeamShowSolid( PartId, bShow)
|
||||
EgtDraw()
|
||||
nPartCnt = nPartCnt + 1
|
||||
if EgtProcessEvents( nPartCnt / nPartTot * 100, 10) == 1 then
|
||||
break
|
||||
end
|
||||
-- passo al pezzo successivo
|
||||
PartId = EgtGetNextPart( PartId)
|
||||
end
|
||||
-- altrimenti solo il pezzo selezionato
|
||||
else
|
||||
-- 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()
|
||||
-- Se il solido già esiste, ne aggiorno lo stato di visualizzazione
|
||||
local SolidId = EgtBeamGetSolid( PartId)
|
||||
if SolidId and EgtGetInfo( SolidId, 'VALID') then
|
||||
EgtBeamShowSolid( PartId, ( EgtGetCalcStatus( SolidId) == GDB_ST.OFF))
|
||||
EgtDraw()
|
||||
return
|
||||
end
|
||||
-- Creazione e visualizzazione del solido
|
||||
EgtBeamCalcSolid( PartId, true)
|
||||
EgtBeamShowSolid( PartId, true)
|
||||
-- Aggiorno visulaizzazione
|
||||
EgtDraw()
|
||||
return
|
||||
end
|
||||
|
||||
-- Creazione e visualizzazione del solido
|
||||
EgtBeamCalcSolid( PartId, true)
|
||||
EgtBeamShowSolid( PartId, true)
|
||||
EgtDraw()
|
||||
|
||||
-- end
|
||||
+135
-110
@@ -1,110 +1,135 @@
|
||||
-- 2021/03/18
|
||||
-- Parti solide gestite come travi BTL
|
||||
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
|
||||
|
||||
-- calcolo del riferimento del minimo box
|
||||
local function SolidMinBox( nId)
|
||||
-- ciclo sulle facce della superficie
|
||||
local nFacCnt = EgtSurfTmFacetCount( nId)
|
||||
local dVolMin
|
||||
local refMin
|
||||
local b3Min
|
||||
for i = 1, nFacCnt do
|
||||
local refFace = EgtSurfTmFacetMinAreaRectangle( nId, i - 1, GDB_ID.ROOT)
|
||||
if refFace then
|
||||
local b3Box = EgtGetBBoxRef( nId, GDB_BB.STANDARD, refFace)
|
||||
if b3Box then
|
||||
local dVol = b3Box:getDimX() * b3Box:getDimY() * b3Box:getDimZ()
|
||||
if not dVolMin or dVol < dVolMin then
|
||||
dVolMin = dVol
|
||||
refMin = refFace
|
||||
b3Min = b3Box
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return refMin, b3Min
|
||||
end
|
||||
|
||||
-- Trasformazione di un oggetto solido
|
||||
local function ProcessOneSolid( nId1, ptPos)
|
||||
|
||||
-- Calcolo il riferimento del suo box minimo
|
||||
local refMin, b3Min = SolidMinBox( nId1)
|
||||
if not refMin then
|
||||
EgtOutText( 'Errore nel calcolo del box minimo della superficie')
|
||||
EgtPause( 1000)
|
||||
return
|
||||
end
|
||||
|
||||
-- Modifico il riferimento in modo che X sia sul più lungo, quindi Z e poi Y
|
||||
local dDimX = b3Min:getDimX()
|
||||
local dDimY = b3Min:getDimY()
|
||||
local dDimZ = b3Min:getDimZ()
|
||||
if dDimX < dDimY then
|
||||
refMin:rotate( refMin:getOrigin(), refMin:getVersZ(), 90)
|
||||
dDimX, dDimY = dDimY, dDimX
|
||||
end
|
||||
if dDimX < dDimZ then
|
||||
refMin:rotate( refMin:getOrigin(), refMin:getVersY(), 90)
|
||||
dDimX, dDimZ = dDimZ, dDimX
|
||||
end
|
||||
if dDimZ < dDimY then
|
||||
refMin:rotate( refMin:getOrigin(), refMin:getVersX(), 90)
|
||||
dDimZ, dDimY = dDimY, dDimZ
|
||||
end
|
||||
|
||||
-- Porto il solido nell'origine
|
||||
refMin:invert()
|
||||
EgtTransform( nId1, refMin, GDB_RT.GLOB)
|
||||
local b3Box = EgtGetBBoxGlob( nId1, GDB_BB.STANDARD)
|
||||
local vtMove = ORIG() - b3Box:getMin()
|
||||
EgtMove( nId1, vtMove, GDB_RT.GLOB)
|
||||
b3Box:move( vtMove)
|
||||
|
||||
-- Creo un nuovo pezzo
|
||||
local PzId = EgtGroup( GDB_ID.ROOT)
|
||||
local PartId = EgtGroup( PzId)
|
||||
EgtSetName( PartId or GDB_ID.NULL, 'Part')
|
||||
local BoxId = EgtGroup( PzId)
|
||||
EgtSetName( BoxId or GDB_ID.NULL, 'Box')
|
||||
local ProcId = EgtGroup( PzId)
|
||||
EgtSetName( ProcId or GDB_ID.NULL, 'Proc')
|
||||
|
||||
-- Sposto il solido nel pezzo
|
||||
EgtRelocate( nId1, ProcId)
|
||||
|
||||
-- Calcolo il box
|
||||
local SboxId = EgtSurfTmBBox( BoxId, b3Box)
|
||||
EgtSetColor( SboxId or GDB_ID.NULL, {206,199,113,30})
|
||||
|
||||
-- Assegno il nome
|
||||
local sText = string.format( 'Part%d %.0f x %.0f x %.0f', PzId, dDimX, dDimY, dDimZ)
|
||||
local ptText = b3Box:getCenter() + Vector3d( 0, 0, dDimZ / 2)
|
||||
local TxtId = EgtTextAdv( PartId, ptText, 0, sText, '', 100, 'S', dDimY / 4, 1, 0, GDB_TI.MC)
|
||||
EgtSetColor( TxtId or GDB_ID.NULL, {0,0,0,100})
|
||||
EgtSetName( PzId or GDB_ID.NULL, sText)
|
||||
|
||||
-- Sposto il pezzo
|
||||
if ptPos then
|
||||
EgtMove( PzId, ptPos - ORIG())
|
||||
end
|
||||
|
||||
EgtDraw()
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------
|
||||
local ptIns = ORIG()
|
||||
local nId = EgtGetFirstSelectedObj()
|
||||
while nId do
|
||||
EgtDeselectObj( nId)
|
||||
ProcessOneSolid( nId, ptIns)
|
||||
ptIns = ptIns + Vector3d( 0, 300, 0)
|
||||
nId = EgtGetFirstSelectedObj()
|
||||
end
|
||||
-- 2025/03/16
|
||||
-- Parti solide gestite come travi BTL
|
||||
|
||||
|
||||
-- Intestazioni
|
||||
require( 'EgtBase')
|
||||
_ENV = EgtProtectGlobal()
|
||||
EgtEnableDebug( false)
|
||||
|
||||
|
||||
-- calcolo del riferimento del minimo box
|
||||
local function SolidMinBox( nId, dMinFaceArea)
|
||||
-- parto con orientamento corrente
|
||||
local refMin = Frame3d()
|
||||
local b3Min = EgtGetBBoxRef( nId, GDB_BB.STANDARD, refMin)
|
||||
local dVolMin = 0.98 * b3Min:getDimX() * b3Min:getDimY() * b3Min:getDimZ()
|
||||
-- ciclo sulle facce della superficie
|
||||
local nFacCnt = EgtSurfTmFacetCount( nId)
|
||||
for i = 1, nFacCnt do
|
||||
local refFace, dL, dW = EgtSurfTmFacetMinAreaRectangle( nId, i - 1, GDB_ID.ROOT)
|
||||
if refFace and ( not dMinFaceArea or dL * dW > dMinFaceArea) then
|
||||
local b3Box = EgtGetBBoxRef( nId, GDB_BB.STANDARD, refFace)
|
||||
if b3Box then
|
||||
local dVol = b3Box:getDimX() * b3Box:getDimY() * b3Box:getDimZ()
|
||||
if not dVolMin or dVol < dVolMin then
|
||||
dVolMin = dVol
|
||||
refMin = refFace
|
||||
b3Min = b3Box
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return refMin, b3Min
|
||||
end
|
||||
|
||||
-- Trasformazione di un oggetto solido
|
||||
local function ProcessOneSolid( nId, ptPos, bFullLayer)
|
||||
|
||||
-- Calcolo il riferimento del suo box minimo
|
||||
local refMin, b3Min = SolidMinBox( nId, 100)
|
||||
if not refMin then
|
||||
refMin, b3Min = SolidMinBox( nId)
|
||||
end
|
||||
if not refMin then
|
||||
EgtOutText( 'Errore nel calcolo del box minimo della superficie (' .. tostring( nId) .. ')')
|
||||
EgtPause( 1000)
|
||||
return false, 0
|
||||
end
|
||||
|
||||
-- Se tutto il layer ricalcolo il box minimo sul layer e determino tutti i suoi oggetti
|
||||
local LayId
|
||||
local vAllId = { nId}
|
||||
if bFullLayer then
|
||||
LayId = EgtGetParent( nId)
|
||||
vAllId = EgtGetAllInGroup( LayId)
|
||||
b3Min = EgtGetBBoxRef( LayId, GDB_BB.STANDARD, refMin)
|
||||
end
|
||||
|
||||
-- Modifico il riferimento in modo che X sia sul più lungo
|
||||
local dDimX = b3Min:getDimX()
|
||||
local dDimY = b3Min:getDimY()
|
||||
local dDimZ = b3Min:getDimZ()
|
||||
if dDimX < dDimY then
|
||||
refMin:rotate( refMin:getOrigin(), refMin:getVersZ(), 90)
|
||||
dDimX, dDimY = dDimY, dDimX
|
||||
end
|
||||
if dDimX < dDimZ then
|
||||
refMin:rotate( refMin:getOrigin(), refMin:getVersY(), 90)
|
||||
dDimX, dDimZ = dDimZ, dDimX
|
||||
end
|
||||
|
||||
-- Porto il solido nell'origine
|
||||
refMin:invert()
|
||||
EgtTransform( vAllId, refMin, GDB_RT.GLOB)
|
||||
local b3Box = EgtGetBBoxGlob( LayId or nId, GDB_BB.STANDARD)
|
||||
local vtMove = ORIG() - b3Box:getMin()
|
||||
EgtMove( vAllId, vtMove, GDB_RT.GLOB)
|
||||
b3Box:move( vtMove)
|
||||
|
||||
-- Creo un nuovo pezzo
|
||||
local PzId = EgtGroup( GDB_ID.ROOT)
|
||||
local PartId = EgtGroup( PzId)
|
||||
EgtSetName( PartId or GDB_ID.NULL, 'Part')
|
||||
local BoxId = EgtGroup( PzId)
|
||||
EgtSetName( BoxId or GDB_ID.NULL, 'Box')
|
||||
local ProcId = EgtGroup( PzId)
|
||||
EgtSetName( ProcId or GDB_ID.NULL, 'Proc')
|
||||
|
||||
-- Sposto il solido nel pezzo
|
||||
for i = 1, #vAllId do
|
||||
EgtRelocate( vAllId[i], ProcId)
|
||||
end
|
||||
|
||||
-- Calcolo il box
|
||||
local SboxId = EgtSurfTmBBox( BoxId, b3Box)
|
||||
EgtSetColor( SboxId or GDB_ID.NULL, {206,199,113,30})
|
||||
|
||||
-- Assegno il nome
|
||||
local sText = string.format( '%.0f x %.0f x %.0f', dDimX, dDimY, dDimZ)
|
||||
local ptText = b3Box:getCenter() + Vector3d( 0, 0, dDimZ / 2)
|
||||
local TxtId = EgtTextAdv( PartId, ptText, 0, sText, '', 100, 'S', dDimY / 4, 1, 0, GDB_TI.MC)
|
||||
EgtSetColor( TxtId or GDB_ID.NULL, {0,0,0,100})
|
||||
|
||||
-- Sposto il pezzo
|
||||
if ptPos then
|
||||
EgtMove( PzId, ptPos - ORIG())
|
||||
end
|
||||
|
||||
return true, dDimY
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- Chiedo se spostare tutti gli oggetti del layer degli oggetti
|
||||
local vsVal = EgtDialogBox( 'SolidProcess',
|
||||
{ 'Full Layer', ' CB:*true,false'})
|
||||
if not vsVal then
|
||||
return
|
||||
end
|
||||
local bFullLayer = ( vsVal[1] == 'true')
|
||||
|
||||
-- Eseguo
|
||||
local ptIns = ORIG()
|
||||
local bOk = true
|
||||
local nId = EgtGetFirstSelectedObj()
|
||||
while nId do
|
||||
EgtDeselectObj( nId)
|
||||
local bOneOk, dDimY = ProcessOneSolid( nId, ptIns, bFullLayer)
|
||||
EgtDraw()
|
||||
bOk = bOk and bOneOk
|
||||
ptIns = ptIns + Vector3d( 0, dDimY + 200, 0)
|
||||
nId = EgtGetFirstSelectedObj()
|
||||
end
|
||||
if not bOk then
|
||||
EgtOutBox( 'Una o più entità selezionate non sono superfici', 'SolidProcess', 'WARNING', 'OK')
|
||||
end
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
[BeamWall]
|
||||
BtlEnable=1
|
||||
BaseDir=C:\EgtData\BeamWall
|
||||
Button1=ClearProcess.lua,Images\ClearProcess.png,Cancella Lavorazioni Pezzo
|
||||
Button2=SolidProcess.lua,Images\SolidProcess.png,Trasforma Solidi in Pezzi
|
||||
Button3=DisableFeatures.lua,Images\DisableFeatures.png,Disabilita Lavorazioni
|
||||
Button4=EnableFeatures.lua,Images\EnableFeatures.png,Abilita Lavorazioni
|
||||
Button5=HideAll.lua,Images\HideAll.png,Nascondi i Pezzi non selezionati
|
||||
Button6=ShowAll.lua,Images\ShowAll.png,Visualizza tutti i Pezzi
|
||||
Button7=ShowSolid.lua,Images\ShowSolid.png,Visualizza/Nascondi Solido
|
||||
Button8=ShowBuilding.lua,Images\ShowBuilding.png,Visualizza Struttura/Visualizza Pezzi
|
||||
Reference in New Issue
Block a user