DataDoors 2.7c1 :

- primo commit con versione corrente.
This commit is contained in:
Dario Sassi
2025-03-18 17:02:20 +01:00
commit cc55202ec5
54 changed files with 97553 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# /
/revision.h
/*.aps
/*.ncb
/*.suo
/*.user
/*.sdf
/*.opensdf
/Debug32
/Release32
/Trial32
/Debug64
/Release64
/ipch
/obj
/.vs
/bin/*.lua
/bin/*.ini
/bin/LuaLibs/*.lua
/bin/Images/*.png
.vscode/settings.json
bin/Images/.placeholder
+60
View File
@@ -0,0 +1,60 @@
REM Compilazione della libreria lua EgtDoors standard 2025.03.18
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
REM Cancellazione precedenti compilazioni
erase /S /Q C:\EgtData\Doors_Sources\Bin\*.*
REM Compilazione luac54
"c:\EgtProg\Dll32\luac54" -o Bin\Machining.lua Machining.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Machining_1.lua Machining_1.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Machining_2.lua Machining_2.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Machining_3v3.lua Machining_3v3.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Machining_4.lua Machining_4.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Machining_5.lua Machining_5.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Machining_6.lua Machining_6.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Main.lua Main.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Main_Assemb.lua Main_Assemb.lua
"c:\EgtProg\Dll32\luac54" -o Bin\Version.lua Version.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_AssemblyDisp.lua LuaLibs\_AssemblyDisp.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_Latch.lua LuaLibs\_Latch.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_LatchCorner.lua LuaLibs\_LatchCorner.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_LatchStrike.lua LuaLibs\_LatchStrike.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_Mortise.lua LuaLibs\_Mortise.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_MortiseCorner.lua LuaLibs\_MortiseCorner.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_OPivot.lua LuaLibs\_OPivot.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_OverHeadArm.lua LuaLibs\_OverHeadArm.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_OverHeadPocket.lua LuaLibs\_OverHeadPocket.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_PivotL.lua LuaLibs\_PivotL.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\_Strike.lua LuaLibs\_Strike.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\ConcealedHinge.lua LuaLibs\ConcealedHinge.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\DOORMatch.lua LuaLibs\DOORMatch.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\EdgePullFlat.lua LuaLibs\EdgePullFlat.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\EdgePullMortiseCyl.lua LuaLibs\EdgePullMortiseCyl.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\EgtDoorsBase.lua LuaLibs\EgtDoorsBase.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\EgtDoorsData.lua LuaLibs\EgtDoorsData.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\EgtDoorsMsg.lua LuaLibs\EgtDoorsMsg.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\EPT.lua LuaLibs\EPT.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\FaceDecoration.lua LuaLibs\FaceDecoration.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Fc_Lines.lua LuaLibs\Fc_Lines.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Fc_Rectangle.lua LuaLibs\Fc_Rectangle.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\FlushBolt.lua LuaLibs\FlushBolt.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\FlushPull.lua LuaLibs\FlushPull.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Groove.lua LuaLibs\Groove.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\ImportNgeFile.lua LuaLibs\ImportNgeFile.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\LockMortiseCyl.lua LuaLibs\LockMortiseCyl.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\LouverCutOut.lua LuaLibs\LouverCutOut.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\MachiningBase.lua LuaLibs\MachiningBase.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\MailSlot.lua LuaLibs\MailSlot.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Main_Assemb_I.lua LuaLibs\Main_Assemb_I.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Main_Assembly.lua LuaLibs\Main_Assembly.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\MortiseHinge.lua LuaLibs\MortiseHinge.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\OverHead.lua LuaLibs\OverHead.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\OverHeadArm.lua LuaLibs\OverHeadArm.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\OverHeadPocket.lua LuaLibs\OverHeadPocket.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Pivot.lua LuaLibs\Pivot.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Rabbet.lua LuaLibs\Rabbet.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\RollerLatch.lua LuaLibs\RollerLatch.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Strike.lua LuaLibs\Strike.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\Viewer.lua LuaLibs\Viewer.lua
"c:\EgtProg\Dll32\luac54" -o Bin\LuaLibs\VisionCutOut.lua LuaLibs\VisionCutOut.lua
File diff suppressed because it is too large Load Diff
+214
View File
@@ -0,0 +1,214 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- DOORMatch.lua by EgalWare s.r.l.
-- definizione del Modulo
local DOORMatch = {}
DOORMatch.OutTemplate = ""
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
-- EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- dichairazione delle variabili locali del modulo che devono essere caricate all'avvio
local TemplateDirectory -- direttorio + file template
local MatchTable -- tabella delle associazioni
local CompoDirectory = ""
local CompoPath = ""
local OutTemplate = ""
-- ricavo il direttorio sorgente
local function CurrCompoDirectory(Path)
local PatternSubString= "(.*)Compo.*"
CompoDirectory = string.match(Path, PatternSubString) .."Compo\\"
return CompoDirectory
end
--
--costruisce il percorso completo della componente RICEVE IL NOME DEL TEMPLATE E IL PERCORSO DEL DIRETTORIO DELLE COMPONENTI
local function CompletetPath()
--local sDir, sName, sExt = EgtSplitPath( CurrCompoPath .. "\\" .. CurrTemplate)
--local sCompletePath = sDir ..'\\' .. sName ..'.lua'
local sCompletePath = CompoDirectory .. "\\" .. TemplateDirectory
CurrCompoDirectory(sCompletePath) -->C:/EgtData/Doors/EgtCompoBase/Compo/
return sCompletePath
end
--
--legge i direttori della tabella controlla cosa deve essere associato
local function CompareDirectory(TemplateTable)
if string.match(TemplateTable,"*")=="*" then
TemplateTable=string.gsub(TemplateTable,"*","(.*)")
end
TemplateTable = string.match(CompoPath, TemplateTable)
-- la stringa della tabella e quella passata non hanno nulla in comune allora ritorno falso
if TemplateTable == nil then
return false
else
return true
end
end
--
--restituisce il nome del file da associare
local function ComputeDirectory(Dir)
-- controllo se ha "*"
if string.match(Dir,"*")=="*" then
-- allora riscrivo la stringa i modo da poter copiare l'argomento al posto dell'asterisco
Dir=string.gsub(Dir,"*","(.*)")
end
-- se il nome passato coincide completamente con quello scritto in tabella allora non devo ricalcolare il percorso
if CompoDirectory==Dir then
return ""
else
-- recupero dal template il nome completo del file da associare alla cartella dei frame
Dir = string.match(CompoPath, Dir) --> C:/EgtData/Doors/EgtCompoBase/Compo/Hinges/SOSS/216 - Hinges/SOSS/(.*)
return Dir --> 216
end
end
--
-- legge nel file .lua la dischiarazione di associazione
local function ReadDefaultParam(File)
ReadingFile = File..".lua"
local f = io.open(ReadingFile,"r")
local t = f:read("*l")
i=0
while t~=nil do
i =1+i
if string.match(t,"%s*--%s*%[Graphic parameters%]")==t then
t = f:read("*l")
t = string.match(t,"%s*--%s*Default%s*=%s*(.*)")
return t
end
t = f:read("*l")
end
f:close()
return "1"
end
--
-- ricerca all'interno del file lua chiamante se esiste un'associazione
local function FileNameInLua( sFile)
local f = io.open( sFile,"r")
if not f then return end
local t = f:read("*l")
local i = 0
while t~=nil do
i = 1 + i
if string.match( t, "%s*--%s*%[Match%]")==t then
t = f:read( "*l")
t = string.match( t, "%s*--%s*FileName%s*=%s*(.*)")
f:close()
return t
end
t = f:read("*l")
end
f:close()
end
--
-- controlla che il file passato esista
local function FileExist( NameFile)
return EgtExistsFile( NameFile)
end
--
--------------------------------------------------------------------------------------------------------------------------------------
--legge la tabella e ricostruisce le associazioni restituendo il file associato
function DOORMatch.Matching(sSourceDirectory ,sTemplateDirectory ,tMatchTable)
print("\n DOORMatch")
print(" ", sTemplateDirectory)
-- caricamento delle variabili
CompoDirectory = sSourceDirectory --< C:/EgtData/Doors/EgtCompoBase/Compo/Hinges
TemplateDirectory = sTemplateDirectory --< SOSS/216
MatchTable = tMatchTable
local OutDirectory = ""
local FIleNameTemlpate = ""
-- costruisco il percorso compoleto
CompoPath = CompletetPath() -->C:/EgtData/Doors/EgtCompoBase/Compo/Hinges/SOSS/216
-- ricerco all'inetrno del file se esiste un'associazione diretta
local AppOutTemplate = FileNameInLua( CompoPath)
if AppOutTemplate then
-- print("\n [Match] FileName = ", AppOutTemplate, "\n")
local sDir, sName, sExt = EgtSplitPath( AppOutTemplate)
return sDir ..sName
end
-- se la ricerca fallisce inizio la ricerca all'interno della tabella delle associazioni
for i=1, #MatchTable do
if CompareDirectory(MatchTable[i].InTemplate) then
-- print("\n",CompoPath, "--> row",i," ", MatchTable[i].InTemplate)
-- carico il valore associato nella tabella in uscita
AppOutTemplate = MatchTable[i].OutTemplate
-- controllo se ha estensione "*"
if string.match( AppOutTemplate,"*") == "*" then --> Hinges/SOSS.Frame/*
AppOutTemplate = string.gsub(AppOutTemplate,"*","") --> Hinges/SOSS.Frame/
OutDirectory = CompoDirectory .. AppOutTemplate --> C:/EgtData/Doors/EgtCompoBase/Compo/Hinges/SOSS.Frame/
FIleNameTemlpate = ComputeDirectory(MatchTable[i].InTemplate) --> 216
OutDirectory = OutDirectory .. FIleNameTemlpate --> C:/EgtData/Doors/EgtCompoBase/Compo/Hinges/SOSS.Frame/216
if FileExist( OutDirectory .. ".lua") then --> C:/EgtData/Doors/EgtCompoBase/Compo/Hinges/SOSS.Frame/216.lua
DOORMatch.OutTemplate = OutDirectory
print("\n", AppOutTemplate .. FIleNameTemlpate) --> Hinges/SOSS.Frame/216
return AppOutTemplate .. FIleNameTemlpate
else
-- print("\n" ,OutDirectory ," doesn't exist")
AppOutTemplate = nil
FIleNameTemlpate = ""
OutDirectory = ""
end
else --> Hinges/SOSS.Frame/212
-- il template in uscita è direttamente un file
OutDirectory = CompoDirectory .. AppOutTemplate --> C:/EgtData/Doors/EgtCompoBase/Compo/Hinges/SOSS.Frame/212
if FileExist( OutDirectory .. ".lua") then --> C:/EgtData/Doors/EgtCompoBase/Compo/Hinges/SOSS.Frame/212.lua
DOORMatch.OutTemplate = OutDirectory
--STU.OutTemplate = AppOutTemplate
print(" ",AppOutTemplate)
return AppOutTemplate
else
print("\n", OutDirectory ," doesn't exist")
AppOutTemplate = nil
OutDirectory = ""
end
end
end
end
-- terminato il ciclo for
if AppOutTemplate == nil then
print("\n no match found")
end
end
function DOORMatch.ReadDefaultParam()
sFile = DOORMatch.OutTemplate ..".lua"
local f = io.open( sFile, "r")
local t = f:read("*l")
local i = 0
while t~=nil do
i =1+i
if string.match(t,"%s*--%s*%[Graphic parameters%]")==t then
t = f:read("*l")
t = string.match(t,"%s*--%s*Default%s*=%s*(.*)")
f:close()
print("Configuration Hardware: ",t)
return t
end
t = f:read("*l")
end
f:close()
return "1"
end
--
return DOORMatch
+1589
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+979
View File
@@ -0,0 +1,979 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- EgtDoorsBase.lua by EgalWare s.r.l. 2016.06.22
-- Doors Base library
-- 2016.06.22 V1.000 FM First version
-- 2019.10.01 V1.001 FM Add function FindProperty
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.10.25 V2.001 FM Add function MakeClcPath
-- 2020.09.30 V2.002 FM Fix error on call EgtVerticalDimension or EgtHorizontalDimension into AssignSize function
-- 2020.09.30 V2.003 FM Fix error into AddSurfTmByExtrusion with open paths
-- 2021.05.27 V2.004 FM Manage hatching regions (special) into AddSurfTmByExtrusion
-- 2021.06.08 V2.005 FM Modify function MakeClcPath to clean corner for DiamondShape
-- 2022.01.17 V2.006 FM Add function MakeConeClcPath
-- 2024.02.21 V2.007 FM Add function mm()
require( 'EgtBase')
require( 'EgtConst')
require( 'EgtLinearDimension')
-- Tavola per definizione modulo
local EgtDoorsBase = {}
print( 'EgtDoorsBase started')
-----------------------------------------------------------------
-- *** log file id ***
-----------------------------------------------------------------
if not sLogIdFile then
sLogIdFile = nil
end
-----------------------------------------------------------------
-- *** DDF file scanning ***
-----------------------------------------------------------------
local g_fh = nil
local g_sUnLine = nil
local g_nLine = 0
-----------------------------------------------------------------
function OpenFile( sFile)
g_fh = io.open( sFile)
g_nLine = 0
return g_fh
end
-----------------------------------------------------------------
function CloseFile()
if not g_fh then return false end
g_fh:close()
g_fh = nil
g_sUnLine = nil
return true
end
-----------------------------------------------------------------
function GetLine()
-- se c'è linea rifiutata
if g_sUnLine then
local sLine = g_sUnLine
g_sUnLine = nil
return sLine
end
-- altrimenti cerco una nuova linea
while true do
-- leggo la prossima linea
local sLine = g_fh:read( '*l')
g_nLine = g_nLine + 1
-- se non esiste, esco
if not sLine then return nil end
-- elimino spazi finali (compresi tab e simili)
sLine = EgtTrimRight( sLine)
-- se linea contiene qualcosa
if sLine:len() > 0 then
-- se non ci sono commenti
local nI = sLine:find( '#', 1, true)
if not nI then return sLine end
-- elimino parti di commento
if nI > 1 and
( sLine:sub( nI-1, nI-1) == ' ' or sLine:sub( nI-1, nI-1) == '\9') then
sLine = EgtTrimRight( sLine:sub( 1, nI-2))
-- se stringa non vuota
if sLine:len() > 0 then return sLine end
end
end
end
end
-----------------------------------------------------------------
function UngetLine( sLine)
g_sUnLine = sLine
end
-----------------------------------------------------------------
function GetLineNumber()
return g_nLine
end
-----------------------------------------------------------------
-- *** Utilities ***
-----------------------------------------------------------------
function OpenPrbFile( sFile, sOpenMode)
local IdPrbFile = io.open( sFile, sOpenMode)
return IdPrbFile
end
-----------------------------------------------------------------
function OpenLogFile( sFile, sOpenMode)
sLogIdFile = io.open( sFile, sOpenMode)
return sLogIdFile
end
-----------------------------------------------------------------
function DoorOutLog( sMessTowrite, nModeWrite)
-- prima scrivo il log dell'egtcam
if nModeWrite <= 0 then
EgtOutLog( sMessTowrite)
end
-- poi scrivo il log del file porta
if sLogIdFile and nModeWrite >= 0 then
sLogIdFile:write( sMessTowrite .. '\n')
end
end
-----------------------------------------------------------------
function CloseLogFile()
if not sLogIdFile then return false end
sLogIdFile:close()
sLogIdFile = nil
return true
end
function inch( val)
return val * GEO.ONE_INCH
end
function mm( val)
return val * GEO.ONE_MM
end
--------------------------------------------------------------------------------
function MakeClcPath( clc, ccr, CL, nGroup, dThick, bInvertPath, bDiamondShape, nIpo1, nIpo2, nIpo3)
local tHint = {}
local nPath
local pIni, pEnd, pCen
-- disegno angolo x-y+
if not bDiamondShape and ccr and ccr > 0 then -- se devo inserire lo scarico dello spigolo
-- calcolo la distanza del centro che equivale alla distanza di inizio arco
local dDeltaCorner = ccr * 0.1 -- calcolo il 10% del raggio
local dCentrDist = (ccr-dDeltaCorner) * sin(45)
local dArcDist = sqrt((ccr*ccr)-(dCentrDist*dCentrDist)) + dCentrDist
local dMidPoindDist = dDeltaCorner * sin(45)
-- linea iniziale
pIni = Point3d(0,-clc,0)
pEnd = Point3d(0,-dArcDist,0)
local nIdLine = EgtLine( nGroup, pIni, pEnd, GDB_RT.LOC)
table.insert( tHint, nIdLine)
-- arco
pIni = pEnd
pCen = Point3d(-dMidPoindDist,dMidPoindDist,0)
pEnd = Point3d(dArcDist,0,0)
local nIdArc = EgtArc3P( nGroup, pIni, pCen, pEnd, GDB_RT.LOC)
table.insert( tHint, nIdArc)
-- linea finale
pIni = pEnd
pEnd = Point3d(clc,0,0)
nIdLine = EgtLine( nGroup, pIni, pEnd, GDB_RT.LOC)
table.insert( tHint, nIdLine)
else
if bDiamondShape then
-- linea iniziale
pIni = Point3d( nIpo2, -nIpo1,0)
pEnd = Point3d(0,0,0)
local nIdLine = EgtLine( nGroup, pIni, pEnd, GDB_RT.LOC)
table.insert( tHint, nIdLine)
-- accorcio la linea
EgtTrimExtendCurveByLen( nIdLine,(clc-nIpo3), pIni, GDB_RT.LOC)
-- linea finale
pIni = pEnd
pEnd = Point3d( nIpo2, nIpo1,0)
nIdLine = EgtLine( nGroup, pIni, pEnd, GDB_RT.LOC)
table.insert( tHint, nIdLine)
-- accorcio la linea
EgtTrimExtendCurveByLen( nIdLine,(clc-nIpo3), pEnd, GDB_RT.LOC)
else
-- linea iniziale
pIni = Point3d(0,-clc,0)
pEnd = Point3d(0,0,0)
local nIdLine = EgtLine( nGroup, pIni, pEnd, GDB_RT.LOC)
table.insert( tHint, nIdLine)
-- linea finale
pIni = pEnd
pEnd = Point3d(clc,0,0)
nIdLine = EgtLine( nGroup, pIni, pEnd, GDB_RT.LOC)
table.insert( tHint, nIdLine)
end
end
nPath = EgtCurveCompo( nGroup, tHint, true)
if nPath then
EgtModifyCurveThickness( nPath, dThick)
EgtSetName( nPath, CL)
if bInvertPath then
-- inverto il percorso
EgtInvertCurve(nPath)
end
end
return nPath
end
--------------------------------------------------------------------------------
function MakeConeClcPath( CLCN, nGroup, dThick, dLengthOri, dMode)
local tHint = {}
local nPath
local pEnd
local nAuxId
local ptApPoint
local dLongLine = EgtIf( dLengthOri, dLengthOri + 1, 1)
-- versori utilizzati
local vtExtrExit, vtExtr
local vtN2 = Vector3d(0,-1,0)
local vtN3 = Vector3d(1,0,0)
-- disegno angolo x-y+
-- sommo i tre versori per avere una direzione media
vtExtrExit = vtN2 + vtN3
vtExtrExit:normalize()
vtExtr = vtExtrExit + Z_AX()
vtExtr:normalize()
if dMode < GEO.EPS_SMALL then
-- prima linea discendente
nAuxId = EgtLine( nGroup, Point3d(0,0,0), Point3d(0,0,dThick), GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- seconda linea
ptApPoint = Point3d( 0, -dLongLine, dThick)
nAuxId = EgtLine( nGroup, Point3d(0,0,dThick), ptApPoint, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- creo linea di ritorno
nAuxId = EgtLine( nGroup, ptApPoint, Point3d(0,0,dThick), GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- quarta linea
ptApPoint = Point3d( dLongLine, 0, dThick)
nAuxId = EgtLine( nGroup, Point3d(0,0,dThick), ptApPoint, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- creo linea di ritorno
nAuxId = EgtLine( nGroup, ptApPoint, Point3d(0,0,dThick), GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- ultima linea di distacco (5mm in direzione utensile)
pEnd = Point3d(0,0,dThick) + ( 5 * vtExtr)
nAuxId = EgtLine( nGroup, Point3d(0,0,dThick), pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
else
-- prima linea discendente al valore di dMode
pEnd = Point3d(0,0,-dMode)
nAuxId = EgtLine( nGroup, Point3d(0,0,0), pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- seconda linea
ptApPoint = Point3d( 0, -dLongLine, -dMode)
nAuxId = EgtLine( nGroup, pEnd, ptApPoint, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- creo linea di ritorno
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- quarta linea
ptApPoint = Point3d( dLongLine, 0, -dMode)
nAuxId = EgtLine( nGroup, pEnd, ptApPoint, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- creo linea di ritorno
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- linea discendente a metà spessore - 1
ptApPoint = pEnd
pEnd = Point3d(0,0,( ( dThick/2) - 1))
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- linea di distacco (pari a dLongLine in direzione utensile)
ptApPoint = pEnd
pEnd = ptApPoint + ( dLongLine * vtExtr)
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- linea discendente alla profondità pari allo spessore
ptApPoint = pEnd
pEnd = Point3d( ptApPoint:getX(), ptApPoint:getY(), dThick)
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- linea discendente inclinata sulla direzione dello spigolo
ptApPoint = pEnd
pEnd = ptApPoint - ( dLongLine * vtExtr)
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- risalita a metà spessore + 1
ptApPoint = pEnd
pEnd = Point3d( ptApPoint:getX(), ptApPoint:getY(), ( ( dThick/2) + 1))
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
-- ultima linea di distacco (5mm in direzione utensile)
ptApPoint = pEnd
pEnd = Point3d(0,0,( ( dThick/2) + 1)) + ( 5 * vtExtr)
nAuxId = EgtLine( nGroup, ptApPoint, pEnd, GDB_RT.GLOB)
table.insert( tHint, nAuxId)
end
-- trasformo in percorso
if #tHint > 0 then
nPath = EgtCurveCompo( nGroup, tHint, true)
end
if nPath then
EgtModifyCurveThickness( nPath, 0)
EgtSetName( nPath, CLCN)
-- modifico versore direzione
EgtModifyCurveExtrusion( nPath, vtExtr, GDB_RT.GLOB)
EgtSetInfo( nPath, 'ActiveStopMach', 1)
EgtSetInfo( nPath, 'SetMaxElev', 1)
end
return nPath
end
--------------------------------------------------------------------------------
local function SetUpRegion( nSrfU, pIni, ptMin, ptMax, sNameDwReg, sNameUpReg, bReference, bGenOutput, dThId, vtExtr, bMove)
local bSurfUp
if not DGD.Dws then
if bMove then
-- EgtMove( nSrfU, Point3d(0,0,(dThId * vtExtr:getZ())) - ORIG())
EgtMove( nSrfU, Point3d(dThId * vtExtr) - ORIG())
end
if abs( pIni:getZ() - ptMin:getZ()) < GEO.EPS_SMALL then -- se geometria è sulla faccia sotto
EgtSetName( nSrfU, sNameDwReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = false
elseif abs( pIni:getZ() - ptMax:getZ()) < GEO.EPS_SMALL then -- se geometria è sulla faccia sopra
EgtSetName( nSrfU, sNameUpReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = true
else -- altrimenti geometria con estremi non corrispondenti con il solido, la cancello
EgtErase(nSrfU)
end
else
if DGD.nTypePz == 3 then -- se frame left
if bMove then
-- EgtMove( nSrfU, Point3d((dThId * vtExtr:getX()),0,0) - ORIG())
EgtMove( nSrfU, Point3d(dThId * vtExtr) - ORIG())
end
if abs( pIni:getX() - ptMin:getX()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sotto
EgtSetName( nSrfU, sNameDwReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = false
elseif abs( pIni:getX() - ptMax:getX()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sopra
EgtSetName( nSrfU, sNameUpReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = true
else -- altrimenti geometria con estremi non corrispondenti con il solido, la cancello
EgtErase(nSrfU)
end
elseif DGD.nTypePz == 4 then -- se frame right
if bMove then
-- EgtMove( nSrfU, Point3d((dThId * vtExtr:getX()),0,0) - ORIG())
EgtMove( nSrfU, Point3d(dThId * vtExtr) - ORIG())
end
if abs( pIni:getX() - ptMax:getX()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sotto
EgtSetName( nSrfU, sNameDwReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = false
elseif abs( pIni:getX() - ptMin:getX()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sopra
EgtSetName( nSrfU, sNameUpReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = true
else -- altrimenti geometria con estremi non corrispondenti con il solido, la cancello
EgtErase(nSrfU)
end
elseif DGD.nTypePz == 5 then -- se frame top
if bMove then
-- EgtMove( nSrfU, Point3d(0,(dThId * vtExtr:getY()),0) - ORIG())
EgtMove( nSrfU, Point3d(dThId * vtExtr) - ORIG())
end
if abs( pIni:getY() - ptMax:getY()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sotto
EgtSetName( nSrfU, sNameDwReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = false
elseif abs( pIni:getY() - ptMin:getY()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sopra
EgtSetName( nSrfU, sNameUpReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = true
else -- altrimenti geometria con estremi non corrispondenti con il solido, la cancello
EgtErase(nSrfU)
end
elseif DGD.nTypePz == 6 then -- se frame bottom
if bMove then
-- EgtMove( nSrfU, Point3d(0,(dThId * vtExtr:getY()),0) - ORIG())
EgtMove( nSrfU, Point3d(dThId * vtExtr) - ORIG())
end
if abs( pIni:getY() - ptMin:getY()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sotto
EgtSetName( nSrfU, sNameDwReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = false
elseif abs( pIni:getY() - ptMax:getY()) < GEO.EPS_SMALL then -- se geometria è sulla relativa faccia sopra
EgtSetName( nSrfU, sNameUpReg)
EgtSetInfo( nSrfU, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
bSurfUp = true
else -- altrimenti geometria con estremi non corrispondenti con il solido, la cancello
EgtErase(nSrfU)
end
end
end
if bGenOutput then
return bSurfUp
end
end
--------------------------------------------------------------------------------
function AddSurfTmByExtrusion( ParId, EntId, bSingleGeom, nSpecialGeom, bSideSurf)
local nIdGeom
local Ls = EgtGetFirstNameInGroup( EgtGetParent(ParId), 'SOLID')
local b3Solid = EgtGetBBoxGlob( Ls, GDB_BB.STANDARD)
if bSingleGeom then
nIdGeom = EntId
else
nIdGeom = EgtGetFirstInGroup( EntId) -- ottengo la prima geometria
end
if not nSpecialGeom then
nSpecialGeom = 0
end
local nSpecialGeomMaster = nSpecialGeom
while nIdGeom do
local nNextId
local dThId
local bExclude = false
local bReference
local nIdNew
if bSingleGeom then
nNextId = nil
dThId = EgtCurveThickness( nIdGeom)
bReference = EgtGetInfo( nIdGeom, 'ReferHw', 'b') or false
else
nNextId = EgtGetNext(nIdGeom)
local sNameGeom = EgtGetName( nIdGeom)
if sNameGeom then
sNameGeom = string.lower(sNameGeom)
if sNameGeom == 'flat_up_tmp' or sNameGeom == 'flat_dw_tmp' or sNameGeom == 'flat_up_tmp_sp' or sNameGeom == 'flat_dw_tmp_sp' or
sNameGeom == 'extrusion' or sNameGeom == 'flat_up_blind' or sNameGeom == 'flat_dw_blind' or sNameGeom == 'flat_up_sd_blind' or
sNameGeom == 'flat_dw_sd_blind' then
bExclude = true
end
end
if not bExclude then
dThId = EgtCurveThickness( nIdGeom)
bReference = EgtGetInfo( nIdGeom, 'ReferHw', 'b') or false
end
end
if not bExclude then
-- recupero versore estrusione in globale
local vtExtr = EgtCurveExtrusion( nIdGeom, GDB_ID.ROOT)
-- recupero versore estrusione in locale
local vtExtrLoc = EgtCurveExtrusion( nIdGeom)
local frEnt = EgtGetGlobFrame( nIdGeom)
local vtMPlane, dDist, dArea = EgtCurveArea( nIdGeom)
-- verifico se è un percorso di hatch
local bHatch = EgtGetInfo( nIdGeom, 'hatch', 'b')
nSpecialGeom = EgtGetInfo( nIdGeom, 'SpecialGeom', 'i')
-- se è un percorso aperto ed è segnato come hatch creo il percorso di contorno
if not vtMPlane and bHatch and not nSpecialGeom then
local nId, nId1, nId2, nId3, nId4
-- faccio gli offset in più e in meno e li unisco con le linee per creare il percorso
nId1 = EgtCopyGlob( nIdGeom, EntId)
EgtOffsetCurve( nId1, 0.5)
nId3 = EgtCopyGlob( nIdGeom, EntId)
EgtOffsetCurve( nId3, -0.5)
-- inverto il percorso 2
EgtInvertCurve( nId3)
-- prendo i punti da collegare
local pIni = EgtEP( nId1)
local pEnd = EgtSP( nId3)
nId2 = EgtLine( EntId, pIni, pEnd, GDB_RT.LOC)
pIni = EgtEP( nId3)
pEnd = EgtSP( nId1)
nId4 = EgtLine( EntId, pIni, pEnd, GDB_RT.LOC)
-- creo percorso
nId = EgtCurveCompo( EntId, {nId1,nId2,nId3,nId4}, true)
EgtModifyCurveThickness( nId, dThId)
EgtSetInfo( nId, 'hatch', bHatch)
EgtSetInfo( nId, 'SpecialGeom', 3)
end
if not nSpecialGeom then
nSpecialGeom = nSpecialGeomMaster
end
-- se il percorso è aperto provo a chiudere il percorso
if not vtMPlane then
local _, nNumCurve = EgtCurveDomain( nIdGeom)
-- se ho più curve, provo a chiuderlo
if nNumCurve > 0 then
--faccio la copia del percorso
nIdNew = EgtCopyGlob( nIdGeom, ParId)
EgtSelectObj(nIdNew)
local ptStart = EgtSP( nIdNew)
local ptEnd = EgtEP( nIdNew)
if ptStart and ptEnd then
local nJoin = EgtLine( ParId, ptEnd, ptStart)
if nJoin then
-- unisco
nIdNew, _ = EgtCurveCompoByChain( ParId, {nIdNew, nJoin}, ptStart)
if nIdNew then
vtMPlane, dDist, dArea = EgtCurveArea( nIdNew)
if not vtMPlane then
-- ottengo il piano dalla curva così come è
_, vtMPlane, dDist = EgtCurveIsFlat( nIdGeom)
EgtErase( nIdNew)
nIdNew = nil
end
else -- ottengo il piano dalla curva così come è
_, vtMPlane, dDist = EgtCurveIsFlat( nIdGeom)
EgtErase( nJoin)
end
else -- ottengo il piano dalla curva così come è
_, vtMPlane, dDist = EgtCurveIsFlat( nIdGeom)
EgtErase( nIdNew)
end
else -- ottengo il piano dalla curva così come è
_, vtMPlane, dDist = EgtCurveIsFlat( nIdGeom)
EgtErase( nIdNew)
end
else -- ottengo il piano dalla curva così come è
_, vtMPlane, dDist = EgtCurveIsFlat( nIdGeom)
end
end
vtMPlane:toGlob(frEnt)
local bInvert
if dArea and dArea * ( vtMPlane * vtExtr) < 0 then -- se oraria la inverto
EgtInvertCurve( nIdGeom)
bInvert = true
end
-- creo le superfici sopra e sotto
local bTrhu
if not DGD.Dws then
bTrhu = ( abs( dThId) > b3Solid:getDimZ() - GEO.EPS_SMALL)
else
if DGD.nTypePz == 5 or DGD.nTypePz == 6 then -- se frames top o bottom
bTrhu = ( abs( dThId) > b3Solid:getDimY() - GEO.EPS_SMALL)
else -- altrimenti frames destro e sinistro
bTrhu = ( abs( dThId) > b3Solid:getDimX() - GEO.EPS_SMALL)
end
end
if bTrhu then -- se spessore passante creo le superfici di sopra e di sotto
-- aggiungo estrusione se non è un percorso speciale (da hatching dei componenti cutout)
if nSpecialGeom <= 1 then
local bCanExtrude
-- se è un percorso importato con hatching leggo la nota del percorso
if nSpecialGeom == 1 then
if not bHatch then
bCanExtrude = true
end
else
bCanExtrude = true
end
-- se puù essere fatta estrusione
if bCanExtrude then
local nExtrs = EgtSurfTmByExtrusion( ParId, nIdGeom, vtExtrLoc * dThId)
if nExtrs then
EgtSetName( nExtrs, 'Extrusion')
EgtSetInfo( nExtrs, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
end
end
end
local nSrfU, nSrfD
if nIdNew then
-- supefice sopra
nSrfU = EgtSurfFlatRegion( ParId, nIdNew)
-- supefice sotto
nSrfD = EgtSurfFlatRegion( ParId, nIdNew)
else
-- supefice sopra
nSrfU = EgtSurfFlatRegion( ParId, nIdGeom)
-- supefice sotto
nSrfD = EgtSurfFlatRegion( ParId, nIdGeom)
end
-- punti massimo e minimo del solido
local ptMin = b3Solid:getMin()
local ptMax = b3Solid:getMax()
local pIni = EgtSP( nIdGeom, GDB_ID.ROOT)
if nSrfU then
SetUpRegion( nSrfU, pIni, ptMin, ptMax, EgtIf( nSpecialGeom >= 2, 'FLAT_DW_TMP_SP', 'FLAT_DW_TMP'), EgtIf( nSpecialGeom >= 2, 'FLAT_UP_TMP_SP', 'FLAT_UP_TMP'), bReference)
end
if nSrfD then
EgtInvertSurf(nSrfD)
SetUpRegion( nSrfD, pIni, ptMin, ptMax, EgtIf( nSpecialGeom >= 2, 'FLAT_UP_TMP_SP', 'FLAT_UP_TMP'), EgtIf( nSpecialGeom >= 2, 'FLAT_DW_TMP_SP', 'FLAT_DW_TMP'), bReference, false, dThId, vtExtrLoc, true)
end
else
-- aggiungo estrusione se non è un percorso speciale (da percorso di hatching)
if nSpecialGeom <= 1 then
local nExtrs = EgtSurfTmByExtrusion( ParId, nIdGeom, vtExtrLoc * dThId)
if nExtrs then
EgtSetName( nExtrs, 'Extrusion')
EgtSetInfo( nExtrs, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
end
end
local nSrfU, nSrfD
if nIdNew then
-- supefice sopra
nSrfU = EgtSurfFlatRegion( ParId, nIdNew)
-- supefice sotto
nSrfD = EgtSurfFlatRegion( ParId, nIdNew)
else
-- supefice sopra
nSrfU = EgtSurfFlatRegion( ParId, nIdGeom)
-- supefice sotto
nSrfD = EgtSurfFlatRegion( ParId, nIdGeom)
end
-- punti massimo e minimo del solido
local ptMin = b3Solid:getMin()
local ptMax = b3Solid:getMax()
local pIni = EgtSP( nIdGeom, GDB_ID.ROOT)
local bSurfUp
if nSrfU then
bSurfUp = SetUpRegion( nSrfU, pIni, ptMin, ptMax, EgtIf( bSpecialGeom, 'FLAT_DW_TMP_SP', 'FLAT_DW_TMP'), EgtIf( bSpecialGeom, 'FLAT_UP_TMP_SP', 'FLAT_UP_TMP'), bReference, true)
end
if nSrfD then
-- if not DGD.Dws then
EgtMove( nSrfD, Point3d(dThId * vtExtrLoc) - ORIG())
-- EgtMove( nSrfD, Point3d(0,0,(dThId * vtExtrLoc:getZ())) - ORIG())
-- else
-- if DGD.nTypePz == 3 or DGD.nTypePz == 4 then -- se frame left o right
-- EgtMove( nSrfD, Point3d((dThId * vtExtrLoc:getX()),0,0) - ORIG())
-- else -- se frame top o bottom
-- EgtMove( nSrfD, Point3d(0,(dThId * vtExtrLoc:getY()),0) - ORIG())
-- end
-- end
if bSurfUp then
if bSideSurf then
EgtSetName( nSrfD, 'FLAT_UP_SD_BLIND')
else
EgtSetName( nSrfD, 'FLAT_UP_BLIND')
end
EgtSetInfo( nSrfD, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
elseif not bSurfUp and bSurfUp ~= nil then
if bSideSurf then
EgtSetName( nSrfD, 'FLAT_DW_SD_BLIND')
else
EgtSetName( nSrfD, 'FLAT_DW_BLIND')
end
EgtSetInfo( nSrfD, 'ReferHw', bReference) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
else -- altrimenti geometria con estremi non corrispondenti con il solido, la cancello
EgtErase(nSrfD)
end
end
end
-- se ho invertito ripristino come precedente
if bInvert then
EgtInvertCurve( nIdGeom)
end
if nIdNew then
EgtErase( nIdNew)
end
if nSpecialGeom and nSpecialGeom == 3 then
EgtErase( nIdGeom)
end
end
nIdGeom = nNextId
end
return true
end
--------------------------------------------------------------------------------
function AddFlatSurf( ParId, EntId)
local nIdGeom
local sSurfName
local Ls = EgtGetFirstNameInGroup( EgtGetParent(ParId), 'SOLID')
nIdGeom = EgtGetFirstInGroup( EntId) -- ottengo la prima geometria
while nIdGeom do
sSurfName = EgtGetName( nIdGeom)
local nNextId = EgtGetNext(nIdGeom)
-- muovo le superfici nel layer SOLID
if sSurfName then
sSurfName = string.lower(sSurfName)
if sSurfName == 'flat_up_tmp' or sSurfName == 'flat_dw_tmp' or sSurfName == 'flat_up_tmp_sp' or sSurfName == 'flat_dw_tmp_sp' or
sSurfName == 'extrusion' or sSurfName == 'flat_up_blind' or sSurfName == 'flat_dw_blind' or sSurfName == 'flat_up_sd_blind' or
sSurfName == 'flat_dw_sd_blind' then
EgtRelocateGlob( nIdGeom, Ls)
end
end
nIdGeom = nNextId
end
return true
end
--------------------------------------------------------------------------------
function InvertSurfName( ParId)
local nIdGeom
local sGeomName
nIdGeom = EgtGetFirstInGroup( ParId) -- ottengo la prima geometria
while nIdGeom do
sGeomName = EgtGetName( nIdGeom)
local nNextId = EgtGetNext(nIdGeom)
-- controllo il nome della geometria
if sGeomName then
sGeomName = string.upper(sGeomName)
if sGeomName == 'FLAT_UP_TMP' then
EgtSetName( nIdGeom, 'FLAT_DW_TMP')
elseif sGeomName == 'FLAT_DW_TMP' then
EgtSetName( nIdGeom, 'FLAT_UP_TMP')
elseif sGeomName == 'FLAT_UP_BLIND' then
EgtSetName( nIdGeom, 'FLAT_DW_BLIND')
elseif sGeomName == 'FLAT_DW_BLIND' then
EgtSetName( nIdGeom, 'FLAT_UP_BLIND')
elseif sGeomName == 'FLAT_UP_SD_BLIND' then
EgtSetName( nIdGeom, 'FLAT_DW_SD_BLIND')
elseif sGeomName == 'FLAT_DW_SD_BLIND' then
EgtSetName( nIdGeom, 'FLAT_UP_SD_BLIND')
end
end
nIdGeom = nNextId
end
return true
end
--------------------------------------------------------------------------------
local function CreateSizeLayer( ParId, nIdLayer, szLayerName)
if not nIdLayer then
nIdLayer = EgtGroup(ParId,GDB_RT.LOC)
EgtSetName(nIdLayer, szLayerName)
EgtSetColor(nIdLayer,BLACK())
-- EgtSetStatus( nIdLayer, GDB_ST.OFF)
end
return nIdLayer
end
--------------------------------------------------------------------------------
function AssignSize( ParId, nIdLDoor, nTypePiece, nCodeQ, ptP1, ptP2, dValue, bHoriz, nUp, nRigth, cSizeColor, bRadius, sSufx, bAngle, nCustomGrid)
-- codice valido
if nCodeQ and nCodeQ >= 0 and nCodeQ <= 17 then
if nCodeQ == 0 and DGD.DIM_DOOR then -- quoto porta
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_DOOR')
elseif nCodeQ == 1 and DGD.DIM_VISION then -- quoto vision cutout
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_VISION')
elseif nCodeQ == 2 and DGD.DIM_LOUVER then -- quoto louver cutout
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_LOUVER')
elseif nCodeQ == 3 and DGD.DIM_LOCK then -- quoto lock
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_LOCK')
elseif nCodeQ == 5 and DGD.DIM_HINGE then -- quoto hinges
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_HINGE')
elseif nCodeQ == 6 and DGD.DIM_MAIL_SLOT then -- quoto mail_slot
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_MAIL_SLOT')
elseif nCodeQ == 7 and DGD.DIM_FLUSH_PULL then -- quoto flush_pull
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_FLUSH_PULL')
elseif nCodeQ == 8 and DGD.DIM_PEEP_HOLE then -- quoto viewer
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_PEEP_HOLE')
elseif nCodeQ == 9 and DGD.DIM_ROLLER_LATCH then -- quoto roller latch
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_ROLLER_LATCH')
elseif nCodeQ == 10 and DGD.DIM_EDGE_PULL then -- quoto edgepull
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_EDGE_PULL')
elseif nCodeQ == 11 and DGD.DIM_FLUSH_BOLT then -- quoto flushbolt
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_FLUSH_BOLT')
elseif nCodeQ == 12 and DGD.DIM_PIVOT then -- quoto pivot
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_PIVOT')
elseif nCodeQ == 14 and DGD.DIM_STRIKE then -- quoto strike
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_STRIKE')
elseif nCodeQ == 17 and DGD.DIM_EPT then -- quoto EPT
nIdLDoor = CreateSizeLayer( ParId, nIdLDoor, 'DIM_EPT')
end
-- imposto la griglia in base al tipo di pezzo
-- if nTypePiece == 3 or nTypePiece == 4 or nTypePiece == 5 then
if nTypePiece == 3 or nTypePiece == 4 then
EgtSetGridFrame( {{0,0,0},{0,0,1},{0,1,0},{-1,0,0}})
elseif nTypePiece == 5 or nTypePiece == 6 then
if nCustomGrid then
EgtSetGridFrame( Frame3d( 0,0,0, nCustomGrid))
else
if nCodeQ == 0 then
EgtSetGridFrame( {{0,DGD.dW,0},{0,-1,0},{0,0,1},{-1,0,0}})
else
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
end
end
else
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
end
local dLenghtArrow = min((0.05 * min(DGD.dH,DGD.dW)), abs(0.3 * dValue))
local dTextSize = min( 30, max( DGD.dW, DGD.dH))
local dTextDist = 5
local sLenTxt = EgtNumToString( EgtToUiUnits( dValue),3)..EgtIf(sSufx, sSufx, '')
-- se devo quotare raccordo
if bRadius and nIdLDoor then
local dDistQuote = 50 + dLenghtArrow
local dAmpArc = EgtIf( nRigth ~= 0, dDistQuote*2, dDistQuote*4)
--CreateLinearDimensionRadial( nIdLDoor, ptP1, ptP2, sLenTxt, dTextSize, dDistQuote, dLenghtArrow, dTextDist, EgtIf( nRigth ~= 0, true, false) , 'R', GDB_RT.GRID, EgtIf( cSizeColor, cSizeColor,BLACK()), dValue, dAmpArc)
CreateLinearDimensionRadial( nIdLDoor, ptP1, ptP2, sLenTxt, dTextSize, dDistQuote, dLenghtArrow, dTextDist, EgtIf( nRigth ~= 0, true, false) , 'R', GDB_RT.GRID, EgtIf( cSizeColor, cSizeColor,BLACK()))
--EgtAlignedDimension( EgtVerticalDimension(nIdLDoor,ptP1, ptP2,{ptP1:getX()+EgtIf( nRigth ~= 0, abs( dDistQuote), -abs( dDistQuote)), ptP1:getY(), ptP1:getZ()},sLenTxt,GDB_RT.GRID), EgtIf( cSizeColor, cSizeColor,BLACK())))
elseif bAngle and nIdLDoor then
dLenghtArrow = abs(0.5 * dValue)
dTextDist = 25
local dDistQuote = 150 + dLenghtArrow + dTextDist
-- riassegno il valore da stampare perché i gradi non vanno convertiti
sLenTxt = EgtNumToString( dValue)..EgtIf(sSufx, sSufx, '')
CreateAngleDimensionRadial( nIdLDoor, ptP1, ptP2, sLenTxt, dTextSize, dValue, dDistQuote, (dDistQuote*0.25), dLenghtArrow, dTextDist, EgtIf( nRigth ~= 0, true, false) , 'A', GDB_RT.GRID, EgtIf( cSizeColor, cSizeColor,BLACK()))
elseif not bHoriz and nIdLDoor then
local dDistQuote = 50 + dLenghtArrow
if nRigth > 0 then
dDistQuote = dDistQuote + DGD.QXP
elseif nRigth == 0 then
dDistQuote = dDistQuote + DGD.QXM
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--CreateLinearDimensionOnY( nIdLDoor, ptP1, ptP2, sLenTxt, dTextSize, dDistQuote, dLenghtArrow, dTextDist, EgtIf( nRigth ~= 0, true, false), 'H', GDB_RT.GRID, EgtIf( cSizeColor, cSizeColor,BLACK()))
local nIdDim = EgtVerticalDimension(nIdLDoor,ptP1, ptP2,{ptP1:getX()+EgtIf( nRigth ~= 0, abs( dDistQuote), -abs( dDistQuote)), ptP1:getY(), ptP1:getZ()},sLenTxt,GDB_RT.GRID)
if nIdDim then
EgtSetColor( nIdDim, EgtIf( cSizeColor, cSizeColor,BLACK()))
end
local bBox = EgtGetBBox( ParId, 0)
if nRigth > 0 then
DGD.QXP = bBox:getMax():getX() - ptP1:getX()
elseif nRigth == 0 then
DGD.QXM = ptP1:getX() - bBox:getMin():getX()
end
elseif nIdLDoor then
local dDistQuote = 50 + dLenghtArrow
if nUp > 0 then
dDistQuote = dDistQuote + DGD.QYP
elseif nUp == 0 then
dDistQuote = dDistQuote + DGD.QYM
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--CreateLinearDimensionOnX( nIdLDoor, ptP1, ptP2, sLenTxt, dTextSize, dDistQuote, dLenghtArrow, dTextDist, EgtIf( nUp ~= 0, true, false), 'W', GDB_RT.GRID, EgtIf( cSizeColor, cSizeColor,BLACK()))
local nIdDim = EgtHorizontalDimension(nIdLDoor,ptP1,ptP2,{ptP1:getX(), ptP1:getY()+EgtIf( nUp ~= 0, abs( dDistQuote), -abs( dDistQuote)), ptP1:getZ()}, sLenTxt,GDB_RT.GRID)
if nIdDim then
EgtSetColor( nIdDim, EgtIf( cSizeColor, cSizeColor,BLACK()))
end
local bBox = EgtGetBBox( ParId, 0)
if nUp > 0 then
DGD.QYP = bBox:getMax():getY() - ptP1:getY()
elseif nUp == 0 then
DGD.QYM = ptP1:getY() - bBox:getMin():getY()
end
end
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
return nIdLDoor
end
return 0
end
--------------------------------------------------------------------------------
function MatchName ( sToFind, sFind)
if sToFind and sFind then
local sCompare = string.gsub( sToFind, ' ', '')
if string.lower(sCompare) == string.lower(sFind) then
return true
end
end
return false
end
--------------------------------------------------------------------------------
function FindMaterial ( sToFind, sFind)
if MatchName( sToFind, sFind) then
return true
end
return false
end
--------------------------------------------------------------------------------
function FindProperty ( tTableToFind, sFind)
if sFind and tTableToFind and #tTableToFind > 0 then
for i = 1, #tTableToFind do
if MatchName( tTableToFind[i], sFind) then
return true
end
end
end
return false
end
-----------------------------------------------------------------
function ResetDoorsLibs()
package.loaded.ConcealedHinge = nil
package.loaded.EdgePullFlat = nil
package.loaded.EdgePullMortiseCyl = nil
-- package.loaded.EgtDoorsBase = nil
package.loaded.EgtDoorsData = nil
package.loaded.EgtDoorsMsg = nil
package.loaded.EPT = nil
package.loaded.FaceDecoration = nil
package.loaded.FlushBolt = nil
package.loaded.FlushPull = nil
package.loaded.Groove = nil
package.loaded.ImportNgeFile = nil
package.loaded._Latch = nil
package.loaded._LatchCorner = nil
package.loaded._LatchStrike = nil
package.loaded.LockMortiseCyl = nil
package.loaded.LouverCutOut = nil
package.loaded.MachiningBase = nil
package.loaded.MailSlot = nil
package.loaded._Mortise = nil
package.loaded._MortiseCorner = nil
package.loaded.MortiseHinge = nil
package.loaded.OverHead = nil
package.loaded._OPivot = nil
package.loaded._OverHeadArm = nil
package.loaded.OverHeadArm = nil
package.loaded._OverHeadPocket = nil
package.loaded.OverHeadPocket = nil
package.loaded.Pivot = nil
package.loaded._PivotL = nil
package.loaded.Rabbet = nil
package.loaded.RollerLatch = nil
package.loaded.Strike = nil
package.loaded._Strike = nil
package.loaded.Viewer = nil
package.loaded.VisionCutOut = nil
package.loaded.Machining = nil
package.loaded.CurrCamInfo = nil
package.loaded.CurrDoorsCustomData = nil
end
return EgtDoorsBase
+228
View File
@@ -0,0 +1,228 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- EgtDoorsData.lua by EgalWare s.r.l. 22.06.2016
-- Doors Data global
-- 2018.11.30 V1.001 FM Add variable DGD.NOBVROT to manage the bevel rotation on particular hardware: roller latch
-- 2019.10.15 V1.002 FM Add variables DGD.tDecorations and DGD.Material
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.11.22 V2.001 FM Add vadiables to new profiles section on all sides
-- 2022.07.27 V2.002 FM Modification to use compiled code
-- Tavola per definizione modulo
local EgtDoorsData = {}
print( 'EgtDoorsData started')
-----------------------------------------------------------------
-- Costanti
COS3 = 0.99862953475457387378449205843944
SIN3 = 0.05233595624294383272211862960908
TAN3 = 0.05240777928304120403880582447398
-----------------------------------------------------------------
-- Dati generali da file DDF
--if not DGD then
-- DGD = {}
--end
-----------------------------------------------------------------
function ResetDoorsGlobDataAssembly()
-- Dati generali
DGD.EGR = 0 -- identificativo codice errore globale
DGD.EGM = '' -- messaggi errori globali
end
-----------------------------------------------------------------
function ResetDoorsGlobData( bImportdxf)
-- Dati generali
DGD.ERR = 0 -- identificativo codice errore
DGD.ERM = '' -- messagi errore
DGD.EMC = '' -- errori di macchina (lavorazioni)
DGD.PZ = GDB_ID.NULL -- identificativo pezzo porta
DGD.bProoduce = true -- flag produzione pezzo
DGD.bMM = true -- flag mm/pollici
DGD.sCode = '' -- codice porta
DGD.tOrder = {} -- tabella con dati dell'ordine
DGD.tOptions = {} -- tabella con dati delle opzioni
DGD.sDate = '' -- data
DGD.dT = 0 -- spessore
if not bImportdxf then
DGD.dW = 0 -- larghezza
DGD.dH = 0 -- altezza
DGD.sSwing = '' -- tipo apertura LH/RH/LHR/RHR/ ...
DGD.sSecSide = '' -- disposizione lato secure UP o DN quando non ci sono profili bevel
DGD.tProfs = {} -- tabella con dati profili ( .trimming, .machining, .offset)
end
DGD.Pressure = 0 -- pressione
DGD.sAliasSwng = '' -- alias tipo di apertura
DGD.tPosition = {} -- posizione rispetto a porta principale
DGD.tSizeLayer = {} -- tabella layer delle quotature
DGD.Material = '' -- Materiale porta (parametri speciali)
DGD.Properties = {} -- proprietà porta (parametri speciali)
DGD.tVisions = {} -- tabella con dati sfinestrature vision ( .shape, ...)
DGD.tLouvers = {} -- tabella con dati sfinestrature louver ( .lenght, ...)
DGD.tMailSlots = {} -- tabella con dati sfinestrature mail_slot ( .template, ...)
DGD.tViewers = {} -- tabella con dati spioncini ( .template, .position, ...)
DGD.tFlushPulls = {} -- tabella con dati sfinestrature flush pull ( .template, .position, .back_set, ...)
DGD.tHinges = {} -- tabella con dati cerniere ( .template, .position, .back_set, .thickness)
DGD.tEPTs = {} -- tabella con dati EPT ( .template, .toptocl, .facetocl, .thickness)
DGD.tLocks = {} -- tabella con dati serrature ( .template, .position, .back_set)
DGD.tFlushBolts = {} -- tabella con dati flush_bolt ( .template, .position, ...)
DGD.tEdgePulls = {} -- tabella con dati edge_pull ( .template, .position, ...)
DGD.tRollerLatchs = {} -- tabella con dati roller_latch ( .template, .side, .position, ...)
DGD.tPivots = {} -- tabella con dati pivot ( .template, .side, .position, ...)
DGD.tStopsAndClosers = {} -- tabella con dati stop and closer ( .template, .position, ...)
DGD.tOHeads = {} -- tabella con dati over head ( .template, .position, ...)
DGD.tStrikes = {} -- tabella con dati strike ( .template, .position, .back_set)
DGD.tGrooves = {} -- tabella con dati groove ( .template, .type, ...)
DGD.tRabbets = {} -- tabella con dati rabbet ( .template, .type, ...)
DGD.tDecorations = {} -- tabella con dati decoration ( .template, .depth, ...)
-- Posizione serratura e flag porta a spinta
DGD.Lock = '' -- 'L' = left, 'R' = right
DGD.Push = false -- true/false
DGD.Position = 0 -- posizione di inserimento della ferramenta
-- posizioni supplementari aggregatore
DGD.PosXItem = 0 -- posizione supplementare aggregatore (per alcuni tipi di ferramenta)
DGD.PosYItem = 0 -- posizione supplementare aggregatore (per alcuni tipi di ferramenta)
DGD.PosZItem = 0 -- posizione supplementare aggregatore (per alcuni tipi di ferramenta)
DGD.PosDir = 1 -- verso di spostamento (positiva/negativa) applicato a posizione supplementare aggregatore
-- variabili per gestire la rotazione delle geometrie su bevel
-- (per quegli item che ruotano tutte le geometrie in esso definite, come ad esempio il roller latch)
DGD.NOBVROT = false -- blocca la rotazione su lato vebel
DGD.LSREF = false -- indica che la geometria base è latch strike, cioè sborda
-- valore posizionamento in Z geometrie con frame exterior
DGD.dZedExtFrame = 0
-- valore posizionamento in X geometrie con frame exterior
DGD.dSideExtFrame = 0
-- valore larghezza ribasso su frame exterior laterali con sill
DGD.dWidthRabbet = 0
-- Coordinate estremi porta
DGD.Lut = 0 -- sinistra sopra alto X di P7
DGD.Lub = 0 -- sinistra sopra basso X di P1
DGD.Ldt = 0 -- sinistra sotto alto X di P10
DGD.Ldb = 0 -- sinistra sotto basso X di P4
DGD.Lm = 0 -- sinistra medio X di P5 e P11
DGD.Lmb = 0 -- sinistra medio X di P5
DGD.Lmt = 0 -- sinistra medio X di P11
DGD.Rut = 0 -- destra sopra alto X di P8
DGD.Rub = 0 -- destra sopra basso X di P2
DGD.Rdt = 0 -- destra sotto alto X di P9
DGD.Rdb = 0 -- destra sotto basso X di P3
DGD.Rm = 0 -- destra medio X di P6 e P12
DGD.Rmb = 0 -- destra medio X di P6
DGD.Rmt = 0 -- destra medio X di P12
DGD.Lua = 0 -- sinistra sopra arco X di P13
DGD.Lda = 0 -- sinistra sotto arco X di P16
DGD.Lma = 0 -- sinistra medio arco X di P17
DGD.Rua = 0 -- destra sopra arco X di P14
DGD.Rda = 0 -- destra sotto arco X di P15
DGD.Rma = 0 -- destra medio arco X di P18
DGD.Bul = 0 -- inferiore sopra sinistra Y di P1
DGD.Bur = 0 -- inferiore sopra destra Y di P2
DGD.Bdl = 0 -- inferiore sotto sinistra Y di P4
DGD.Bdr = 0 -- inferiore sotto destra Y di P3
DGD.Bm = 0 -- inferiore medio Y di P5 e P6
DGD.Bml = 0 -- inferiore medio Y di P5
DGD.Bmr = 0 -- inferiore medio Y di P6
DGD.Tul = 0 -- superiore sopra sinistra Y di P7
DGD.Tur = 0 -- superiore sopra destra Y di P8
DGD.Tdl = 0 -- superiore sotto sinistra Y di P10
DGD.Tdr = 0 -- superiore sotto destra Y di P9
DGD.Tm = 0 -- superiore medio Y di P11 e P12
DGD.Tml = 0 -- superiore medio Y di P11
DGD.Tmr = 0 -- superiore medio Y di P12
DGD.Aul = 0 -- curva sopra sinistra Y di P13
DGD.Aur = 0 -- curva sopra destra Y di P14
DGD.Adl = 0 -- curva sotto sinistra Y di P16
DGD.Adr = 0 -- curva sotto destra Y di P15
DGD.Aml = 0 -- curva medio sinistra Y di P17
DGD.Amr = 0 -- curva medio destra Y di P18
DGD.Aut = 0 -- curva sopra alto Y di P19
DGD.Adt = 0 -- curva sotto alto Y di P20
DGD.Amt = 0 -- curva medio alto Y di P21
DGD.Cmu = 0 -- curva medio alto top X di P19
DGD.Cmd = 0 -- curva medio alto bot X di P20
DGD.Cmm = 0 -- curva medio alto med X di P21
DGD.RMa = 0 -- curva max destra X di P22
DGD.LMa = 0 -- curva max sinistra X di P23
DGD.AMr = 0 -- curva max destra Y di P22
DGD.AMl = 0 -- curva max sinistra Y di P23
DGD.rma = 0 -- curva min destra X di P24
DGD.lma = 0 -- curva min sinistra X di P25
DGD.amr = 0 -- curva min destra Y di P24
DGD.aml = 0 -- curva min sinistra Y di P25
DGD.Dpu = 0 -- Delta proiez angolo sopra Y delta
DGD.Dpd = 0 -- Delta proiez angolo sotto Y delta
DGD.Dpm = 0 -- Delta proiezione angolo Y delta medio
DGD.Ult = 0 -- sopra sinistra alto Z di P7
DGD.Ulb = 0 -- sopra sinistra basso Z di P1
DGD.Urt = 0 -- sopra destra alto Z di P8
DGD.Urb = 0 -- sopra destra basso Z di P2
DGD.Dlt = 0 -- sotto sinistra alto Z di P10
DGD.Dlb = 0 -- sotto sinistra basso Z di P4
DGD.Drt = 0 -- sotto destra alto Z di P9
DGD.Drb = 0 -- sotto destra basso Z di P3
DGD.Mlt = 0 -- medio sinistra alto Z di P11
DGD.Mlb = 0 -- medio sinistra basso Z di P5
DGD.Mrt = 0 -- medio destra alto Z di P12
DGD.Mrb = 0 -- medio destra basso Z di P6
DGD.Ula = 0 -- sopra sinistra arco Z di P13
DGD.Ura = 0 -- sopra destra arco Z di P14
DGD.Dla = 0 -- sotto sinistra arco Z di P16
DGD.Dra = 0 -- sotto destra arco Z di P15
DGD.Mla = 0 -- medio sinistra arco Z di P17
DGD.Mra = 0 -- medio destra arco Z di P18
-- variabile top porta con angolo
DGD.Tpa = nil
-- variabili per lati porta lavorati
DGD.MHS = 0 -- machine hinge side
DGD.MLS = 0 -- machine lock side
DGD.MTS = 0 -- machine top side
DGD.MBS = 0 -- machine bottom side
-- variabili per punti e direzioni porta
DGD.A1 = 0
DGD.A2 = 0
DGD.A3 = 0
DGD.A4 = 0
DGD.A5 = 0
DGD.A6 = 0
DGD.A7 = 0
DGD.A8 = 0
-- variabili per quotature
DGD.QXP = 0
DGD.QXM = 0
DGD.QYP = 0
DGD.QYM = 0
-- variabile conteggio probe
DGD.CPR = 0
DGD.DPR = 15
-- variabile match profilo edge break (EB)
DGD.EBP = ''
-- variabile forzatura sbordo lato narrow del tipo hardware Groove
DGD.GRS = nil
-- variabile settata dal prod. 0: nessuna tastatura completa; 1: tastatura completa, fase tastatura porta attivata; 2: tastatura completa: fase generazione porta
-- DGD.PROBE = 0
-- Flags
-- tipo esecuzione (se non impostato default entrambe)
if not DGD.MachEn then
DGD.MachEn = 2 -- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
end
-- Inactive doors con lato bevel invertito automaticamente
DGD.RevInBv = 0 -- 0 non invertito automaticamente, 1 invertito automaticamente
-- Swing drive disposition ( enable or disable) to calculate disposition ( only without bevel profiles)
DGD.SwDD = 1 -- 0 upper and lower geometries found drive the disposition; 1 swing drive disposition
end
return EgtDoorsData
+597
View File
@@ -0,0 +1,597 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- EgtDoorsMsg.lua by EgalWare s.r.l. 22.06.2016
-- Doors messages
-- 2019.10.18 V2.000 FM Manage use Materials
-- Tavola per definizione modulo
local EgtDoorsMsg = {}
print( 'EgtDoorsMsg started')
if EgtGetLanguage() == 'ITA' then
EgtDoorsMsg[400] = " Il diametro utensile %s: %s deve essere uguale o maggiore di: %s. Controllare gli utensili"
EgtDoorsMsg[401] = " Il parametro %s: %s deve essere maggiore di 0\n Verificare il parametro nel file: %s "
EgtDoorsMsg[402] = " Il parametro %s: %s deve essere maggiore del diametro utensile(%s): %s\n Verificare gli utensili o il parametro nel file: %s "
EgtDoorsMsg[403] = " Il parametro %s: %s deve essere compreso tra i valori minimo: %s e massimo: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[404] = " Il parametro %s: %s deve essere maggiore o uguale a 0\n Verificare il parametro nel file: %s "
EgtDoorsMsg[405] = " Il parametro %s: %s deve essere maggiore o uguale del diametro utensile: %s\n Verificare gli utensili o il parametro nel file: %s "
EgtDoorsMsg[406] = " Il parametro %s: %s deve essere minore del parametro %s: %s\n Verificare i parametri nel file: %s "
EgtDoorsMsg[407] = " Il parametro %s: %s deve essere maggiore del parametro %s: %s\n Verificare i parametri nel file: %s "
EgtDoorsMsg[408] = " Errore! Mancano i parametri delle dimensione L e W o R nel file ddf"
EgtDoorsMsg[409] = " Il parametro interasse fori %s: %s deve essere maggiore del diametro foro maniglia: %s\n Verificare i parametri nel file: %s "
EgtDoorsMsg[410] = " Il parametro %s: %s deve essere maggiore o uguale della somma tra %s+%s: %s\n Verificare i parametri nel file: %s "
EgtDoorsMsg[411] = " Errore! File (lua o nge) non riconosciuto: %s\n Verificare i parametri nel file: %s "
EgtDoorsMsg[412] = " Errore! Impossibile importare il file geometrico: %s. Verificare il file nge "
EgtDoorsMsg[413] = " Errore! La geometria: %s del gruppo %s: %s, ha la nota SideDoor sconosciuta: %s\n Verificare i file nge importati nel ddf: %s "
EgtDoorsMsg[414] = " Errore! La Geometria: %s del gruppo %s: %s, non ha nessuna nota SideDoor specificata\n Verificare i file nge importati nel ddf: %s "
EgtDoorsMsg[415] = " Errore! La geometria: %s profilo %s ha la nota InserPoint sconosciuta: %s\n Verificare i file nge importati nel ddf: %s "
EgtDoorsMsg[416] = " Errore! La Geometria: %s profilo %s non ha nessuna nota InserPoint specificata\n Verificare i file nge importati nel ddf: %s "
EgtDoorsMsg[417] = " Il parametro %s: %s accetta solo valore: 0, 1 o -1\n Verificare il parametro nel file: %s "
EgtDoorsMsg[418] = " Errore! La geometria: %s dello spioncino: %s, ha la nota SideDoor sconosciuta: %s\n Verificare i file nge importati nel ddf: %s "
EgtDoorsMsg[419] = " Errore! La Geometria: %s dello spioncino: %s, non ha nessuna nota SideDoor specificata\n Verificare i file nge importati nel ddf: %s "
EgtDoorsMsg[420] = " Il parametro interasse fori %s: %s deve essere maggiore del diametro spioncino: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[421] = " Errore! Mancano i parametri delle dimensione L e W o R\n Verificare i parametri nel file: %s "
EgtDoorsMsg[422] = " Il parametro %s: %s deve essere maggiore o uguale del parametro %s: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[423] = " Il parametro %s: %s è troppo grande e fa debordare la cava interna, max valore accettato: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[424] = " Il parametro %s: %s è troppo piccolo e fa debordare la cava interna, min valore accettato: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[425] = " Concatenamento percorsi inversi non riuscito\n Inviare il file ddf e il file %s al vostro servizio di assistenza "
EgtDoorsMsg[426] = " Concatenamento percorsi non riuscito\n Inviare il file ddf e il file %s al vostro servizio di assistenza "
EgtDoorsMsg[427] = " Creazione percorso composito non riuscito\n Inviare il file ddf e il file %s al vostro servizio di assistenza "
EgtDoorsMsg[428] = " Non è ammesso l'inserimento cerniera Mortise: %s sul lato cerniere con profilo tipo toro o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[429] = " Non è ammesso l'inserimento cerniera Concealed: %s sul lato cerniere con profilo bisello, bullnose o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[430] = " Non è ammesso l'inserimento serratura: %s sul lato serratura con profilo tipo toro o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[431] = " Non è ammesso l'inserimento edge pull: %s sul lato serratura con profilo tipo toro o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[432] = " Impossibile inserire un Over Head Arm: %s. Il Parametro H: %s è più grande o uguale dello spessore porta: %s\n Verificare il file ddf e il file %s"
EgtDoorsMsg[433] = " Lo spessore porta %s è troppo elevato per il raggio profilo %s: %s. Verificare il file ddf "
EgtDoorsMsg[434] = " Errore apertura file ddf. Verificare che file ddf esista e non sia danneggiato"
EgtDoorsMsg[435] = " Errore nella lettura Unità di misura. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[436] = " Errore nella lettura Codice. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[437] = " Errore nella lettura Ordine. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[438] = " Errore nella lettura Data. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[439] = " Errore nella lettura Dimensioni. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[440] = " Errore nella lettura Brandeggio: %s. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[441] = " Errore nella lettura Profili: parametro overmaterial mancante. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[442] = " Nessun VisionCutOut trovato"
EgtDoorsMsg[443] = " Nessun LouverCutOut trovato"
EgtDoorsMsg[444] = " Nessun MailSlot trovato"
EgtDoorsMsg[445] = " Nessun Viewer trovato"
EgtDoorsMsg[446] = " Nessun Flush Pull trovato"
EgtDoorsMsg[447] = " Nessun Hinges trovato"
EgtDoorsMsg[448] = " Nessun Lock trovato"
EgtDoorsMsg[449] = " Nessun Flush Bolt trovato"
EgtDoorsMsg[450] = " Nessun Edge Pull trovato"
EgtDoorsMsg[451] = " Nessun Roller Latch trovato"
EgtDoorsMsg[452] = " Nessun Pivot trovato"
EgtDoorsMsg[453] = " Nessun Stop And Closer trovato"
EgtDoorsMsg[454] = " Errore nella creazione della Porta. Verificare il file ddf"
EgtDoorsMsg[455] = " Errore nelle lavorazioni della Porta. Verificare il file ddf, utensili e lavorazioni"
EgtDoorsMsg[456] = " Il parametro %s: %s deve essere minore o uguale del parametro %s: %s\n Verificare i parametri nel file: %s "
EgtDoorsMsg[457] = " Impossibile caricare il file geometrico personalizzato: %s. Verificare il file nge "
EgtDoorsMsg[458] = " Errore. La ferramenta tipo %s è ammessa solo su una porta inattiva, tipo porta corrente: %s. Verificare il file ddf "
EgtDoorsMsg[459] = " Il parametro %s: %s deve essere maggiore di 0 e minore o uguale del diametro utensile: %s\n Verificare gli utensili o il parametro nel file: %s "
EgtDoorsMsg[460] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità cava piastrina: %s perché è maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[461] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità cava mortasa: %s perché è maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[462] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità cava piastrina: %s perché è maggiore della massima lavorazione dell'utensile anti scheggia: %s "
EgtDoorsMsg[463] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità del foro: %s perché è maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[464] = " Impossibile inserire un pivot tipo center Hung: %s sul profilo cerniere tipo Bevel: %s "
EgtDoorsMsg[465] = " Impossibile inserire un pivot tipo intermediate: %s sul profilo cerniere tipo bullnose o concavo: %s "
EgtDoorsMsg[466] = " Attenzione! (%s) Non è stata trovata nessuna lavorazione all'indice: %s associata alla geometria: %s\n Verrà utilizzato il diametro utensile definito nel modello: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[467] = " Attenzione! (%s) Impossibile impostare la lavorazione: %s all'indice: %s associata alla geometria: %s\n Verrà utilizzato il diametro utensile definito nel modello: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[468] = " Attenzione! (%s) Impossibile acquisire i parametri dalla lavorazione: %s all'indice: %s associata alla geometria: %s \n Verificare la lavorazione \n Verrà utilizzato il diametro utensile definito nel modello: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[469] = " Attenzione! (%s) Impossibile acquisire l'utensile dalla lavorazione: %s all'indice: %s associata alla geometria: %s\n Verificare la lavorazione \n Verrà utilizzato il diametro utensile definito nel modello: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[470] = " Attenzione! (%s) Impossibile acquisire il diametro utensile dalla lavorazione: %s all'indice: %s associata alla geometria: %s\n Verificare i dati utensile \n Verrà utilizzato il diametro utensile definito nel modello: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[471] = " Attenzione! (%s) Nome geometria: %s non presente o disabilitata in MTable \n Verificare la MTable \n Verrà utilizzato il diametro utensile: %s definito nel modello\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[472] = " Attenzione! (%s) Impossibile acquisire massimo materiale utensile dalla lavorazione: %s all'indice: %s associata alla geometria: %s\n Verificare i dati utensile \n Verrà utilizzato il diametro utensile definito nel modello: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[473] = " Attenzione! (%s) Impossibile acquisire massimo materiale utensile dalla lavorazione: %s all'indice: %s associata alla geometria: %s\n Verificare i dati utensile \n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[474] = " Errore nel posizionamento grezzo sulla tavola"
EgtDoorsMsg[475] = " Errore nella creazione delle lavorazioni della macchina: %s Il file cnc non verrà generato per questa macchina"
EgtDoorsMsg[476] = "Errore"
EgtDoorsMsg[477] = "ERRORE"
EgtDoorsMsg[478] = "Errore nella generazione del codice CN della macchina: %s. Verificare se ci sono tutti gli utensili richiesti nel file di SetUp: %s"
EgtDoorsMsg[479] = "Porta ribaltata: Secure in alto"
EgtDoorsMsg[480] = "Porta normale: Keyway in alto"
EgtDoorsMsg[481] = ", Top a destra"
EgtDoorsMsg[482] = ", Top a sinistra"
EgtDoorsMsg[483] = " Lavorazione nulla o non definita su geometria: %s id geometria: %s Verificare MTable\n"
EgtDoorsMsg[484] = " Errore! Lavorazione: %s non esistente o non valida ( associata alla geometria: %s id geometria: %s)\n Verificare MTable o MachDb"
EgtDoorsMsg[485] = " Errore! Impossibile inserire o applicare la lavorazione: %s alla geometria: %s id geom: %s\n Verificare la lavorazione e la geometria"
EgtDoorsMsg[486] = "Errore nel caricamento dati CAM presenti nel file: %s"
EgtDoorsMsg[487] = "Errore! File %s: %s non trovato o non leggibile"
EgtDoorsMsg[488] = "Attenzione! Macchina: %s non trovata"
EgtDoorsMsg[489] = "Errore! Dati macchina non validi nel file: %s"
EgtDoorsMsg[490] = "Errore! Tabella MTable non configurate nel file: %s"
EgtDoorsMsg[491] = "Errore! Nome macchina: %s non presente in MTable"
EgtDoorsMsg[492] = " Attenzione! Generazione CN della macchina: %s è disabilitato dai settaggi della MTable"
EgtDoorsMsg[493] = " Nessuna lavorazione per macchina: %s con numero pezzo: %s nome pezzo: %s"
EgtDoorsMsg[494] = " Inizio lavorazioni su macchina: %s"
EgtDoorsMsg[495] = "Disposizione Porta"
EgtDoorsMsg[496] = " alla geometria (numero): "
EgtDoorsMsg[497] = " Saltata geometria: "
EgtDoorsMsg[498] = "Generazione Lavorazioni conclusa "
EgtDoorsMsg[499] = " Attenzione! tabella MTable non presente nel progetto corrente"
EgtDoorsMsg[500] = " Attenzione! Porta non Inattiva con opposti profili tipo bevel. Brandeggio: %s Lato cerniere: %s Lato serratura: %s"
EgtDoorsMsg[501] = "Attenzione"
EgtDoorsMsg[502] = "ATTENZIONE"
EgtDoorsMsg[503] = " Attenzione! (%s) Nome geometria: %s non presente o disabilitata in MTable \n Verificare la MTable \n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[504] = " Attenzione! (%s) Non è stata trovata nessuna lavorazione all'indice: %s associata alla geometria: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[505] = " Attenzione! (%s) Impossibile impostare la lavorazione: %s all'indice: %s associata alla geometria: %s\n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[506] = " Attenzione! (%s) Impossibile acquisire i parametri dalla lavorazione: %s all'indice: %s associata alla geometria: %s \n Verificare la lavorazione \n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[507] = " Attenzione! (%s) Impossibile acquisire l'utensile dalla lavorazione: %s all'indice: %s associata alla geometria: %s\n Verificare la lavorazione \n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[508] = " Attenzione! (%s) Impossibile acquisire il diametro utensile dalla lavorazione: %s all'indice: %s associata alla geometria: %s\n Verificare i dati utensile \n Nessuna correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[509] = " Attenzione! (%s) MTable non trovata nelle note del progetto\n Verificare il progetto\n Nessuna correzione diametro utensile ne correzione della profondità della geometria verrà effettuata"
EgtDoorsMsg[510] = ", Distanziale in Y"
EgtDoorsMsg[511] = "Disp"
EgtDoorsMsg[512] = "Parametri incongruenti nel file ddf in prossimità della lina: %s della ferramenta tipo: %s"
EgtDoorsMsg[513] = "Vision ritaglio"
EgtDoorsMsg[514] = "Louver ritaglio"
EgtDoorsMsg[515] = "Mail slot"
EgtDoorsMsg[516] = "Viewer"
EgtDoorsMsg[517] = "Flush pull"
EgtDoorsMsg[518] = "Hinge"
EgtDoorsMsg[519] = "Lock"
EgtDoorsMsg[520] = "FlushBolt"
EgtDoorsMsg[521] = "EdgePull"
EgtDoorsMsg[522] = "Roller latch"
EgtDoorsMsg[523] = "Pivot"
EgtDoorsMsg[524] = "StopAndCloser"
EgtDoorsMsg[525] = "Over Head Stop_Closer"
EgtDoorsMsg[526] = " Nessun Over Head trovato"
EgtDoorsMsg[527] = " Il parametro %s: %s è troppo grande e fa debordare il foro, max valore accettato: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[528] = " Disposizione per Cms-PF122R8RR :"
EgtDoorsMsg[529] = " Disposizione per Multiax-N1216 :"
EgtDoorsMsg[530] = " Errore su ricerca gruppo tavola MOBILE or FIXED"
EgtDoorsMsg[531] = " Errore in disposizione ventose: insufficienti ventose attive. Verificare le sfinestrature o lavorazioni di hardware in prossimità delle ventose"
EgtDoorsMsg[532] = " Errore in disposizione ventose: troppe ventose disattivate sulla parte destra. Verificare le sfinestrature o lavorazioni di hardware in prossimità delle ventose"
EgtDoorsMsg[533] = " Errore in disposizione ventose: troppe ventose disattivate nella parte centrale della porta. Verificare le sfinestrature o lavorazioni di hardware in prossimità delle ventose"
EgtDoorsMsg[534] = " Errore in disposizione ventose: troppe ventose disattivate nella parte sinistra. Verificare le sfinestrature o lavorazioni di hardware in prossimità delle ventose"
EgtDoorsMsg[535] = " Nessun Strike trovato"
EgtDoorsMsg[536] = " Nessun Groove trovato"
EgtDoorsMsg[537] = " Nessun Rabbet trovato"
EgtDoorsMsg[538] = "Strike"
EgtDoorsMsg[539] = "Groove"
EgtDoorsMsg[540] = " Impossibile inserire la Groove: %s. Il Parametro H: %s è più grande o uguale dello spessore porta: %s\n Verificare il file ddf e il file %s"
EgtDoorsMsg[541] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità del percorso anti scheggia: %s perché è maggiore della massima lavorazione dell'utensile anti scheggia: %s "
EgtDoorsMsg[542] = " Attenzione! (%s) nel modello: %s la larghezza gola: %s è minore dello spessore lama: %s "
EgtDoorsMsg[543] = " il DDF non ha nessun parametro: Secure"
EgtDoorsMsg[544] = " Errore! parametri definizione porta incongruenti. Brandeggio: %s tipo disposizione bevel: %s parametro disposizione SECURE: %s. Verificare il file ddf"
EgtDoorsMsg[545] = " Errore! parametri definizione porta mancanti. profilo bevel non trovato e parametro SECURE non trovato. Verificare il file ddf"
EgtDoorsMsg[546] = " Non è ammesso l'inserimento gola Rabbet sul lato cerniere con profilo tipo toro o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[547] = " Non è ammesso l'inserimento gola Rabbet sul lato serratura con profilo tipo toro o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[548] = " Errore! Parametro side della ferramenta rabbet è incongruente: %s. Verificare il file ddf "
EgtDoorsMsg[549] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità cava: %s perché è maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[550] = "Rabbet"
EgtDoorsMsg[551] = " Errore negli import attrezzaggi utensili\n Verificare se è stato definito un file di attrezzaggio nella sezione SETUP e inserito nel file CurrCamInfo.lua"
EgtDoorsMsg[552] = " Errore nell'attrezzaggio utensili: %s"
EgtDoorsMsg[553] = " Lista utensili non attrezzati o mancanti: "
EgtDoorsMsg[554] = " File di setup vuoto o non caricato: %s"
EgtDoorsMsg[555] = "nessuno"
EgtDoorsMsg[556] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità cava piastrina: %s perché è maggiore della massima lavorazione dell'utensile chisel: %s "
EgtDoorsMsg[557] = " Nessun EPT trovato"
EgtDoorsMsg[588] = "EPT"
EgtDoorsMsg[589] = " Non è ammesso l'inserimento EPT: %s sul lato cerniere con profilo tipo toro o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[590] = " Errore! parametri definizione porta mancanti. Questa porta è priva di profilo bevel e il parametro SECURE non trovato nel file DDF e non trovato nel file CurrCamInfo"
EgtDoorsMsg[591] = " Errore! Parametro: %s non definito o parametro type nel ddf non pertinente. Verificare il file del modello: %s o il parametro Type nel ddf della porta"
EgtDoorsMsg[592] = " Errore! Parametro: %s non definito. Verificare il file ddf della porta"
EgtDoorsMsg[593] = " Attenzione! %s puo essere applicato solo sul lato %s. Verificare il file ddf "
EgtDoorsMsg[594] = " Errore! %s non può essere applicato sul lato %s. Verificare il file ddf "
EgtDoorsMsg[595] = " lavorazione: "
EgtDoorsMsg[596] = " fase: "
EgtDoorsMsg[597] = " Errore! File di tabella non trovato: %s "
EgtDoorsMsg[598] = " Errore! Impossible inserire o applicare la lavorazione: %s alla geometria: %s id geom: %s\n Id errore: %s Errore: %s\n Verificare la lavorazione e la geometria"
EgtDoorsMsg[599] = " Nessuna porta trovata"
EgtDoorsMsg[600] = " Nessuna porta secondaria trovata"
EgtDoorsMsg[601] = " Nessun telaio sinistro trovato"
EgtDoorsMsg[602] = " Nessun telaio destro trovato"
EgtDoorsMsg[603] = " Nessun telaio top trovato"
EgtDoorsMsg[604] = " Errore! Modelli ferramenta non in sequenza. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[605] = "Sinistro"
EgtDoorsMsg[606] = "Destro"
EgtDoorsMsg[607] = "Superiore"
EgtDoorsMsg[608] = "Soglia"
EgtDoorsMsg[609] = " Errore! Definizione parametri telaio incongruenti. Lato pezzo: %s tipo pezzo: %s Serraura su lato: %s. Check ddf file"
EgtDoorsMsg[610] = "Telaio ribaltato: Secure in alto"
EgtDoorsMsg[611] = "Telaio normale: Keyway in alto"
EgtDoorsMsg[612] = " Attenzione! (%s) nel modello: %s è stato ridotto la profondità del percorso ripresa spigoli: %s perché è maggiore della massima lavorazione dell'utensile ripresa spigoli: %s "
EgtDoorsMsg[613] = " Errore nella lettura Profili: parametro raggio o angolo mancante. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[614] = " Errore nella lettura Profili: raggio troppo piccolo. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[615] = " Errore nella lettura Profili: profili laterali non corrispondono con profilo ad arco. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[616] = " Errore! Altezza pezzo (%s) %s + sovramateriale %s: %s eccede max altezza configurata - traslazione in X %s: %s (nel file CurrCamInfo)."
EgtDoorsMsg[617] = " Errore! Altezza pezzo (%s) %s + sovramateriale %s: %s è inferiore min altezza configurata - traslazione in X %s: %s (nel file CurrCamInfo)."
EgtDoorsMsg[618] = " Errore! Larghezza pezzo (%s) %s + doppio sovramateriale %s: %s eccede max larghezza configurata - traslazione in Y %s: %s (nel file CurrCamInfo)."
EgtDoorsMsg[619] = " Errore! Larghezza pezzo (%s) %s + doppio sovramateriale %s: %s è inferiore min larghezza configurata - traslazione in X %s: %s (nel file CurrCamInfo)."
EgtDoorsMsg[620] = " Errore! Spessore pezzo (%s): %s eccede max spessore configurato: %s (nel file CurrCamInfo)."
EgtDoorsMsg[621] = " Errore! Spessore pezzo (%s): %s inferiore min spessore configurato: %s (nel file CurrCamInfo)."
EgtDoorsMsg[622] = " Porta"
EgtDoorsMsg[623] = " Telaio"
EgtDoorsMsg[624] = " Il parametro %s: %s è troppo grande e fa debordare la seconda mortasa, max valore accettato: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[625] = " Il parametro %s: %s è troppo piccolo e fa debordare la seconda mortasa, min valore accettato: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[626] = " Il parametro %s: %s è troppo grande, max valore accettato: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[627] = " Il parametro %s: %s è troppo piccolo, min valore accettato: %s\n Verificare il parametro nel file: %s "
EgtDoorsMsg[628] = " Errore! Non è possibile gestire porta ad arco con funzione tastatura completa."
EgtDoorsMsg[629] = " Errore! Le Dimensioni della porta tastata H=%s W=%s T=%s eccedono la tolleranza DGC.Dh=%s DGC.Dw=%s DGC.Dt=%s rispetto alle dimensioni del del DDF H=%s W=%s T=%s. Verificare il pezzo tastato"
EgtDoorsMsg[630] = " Errore nella creazione della Porta. Verificare le dimensioni del pezzo in macchina"
EgtDoorsMsg[631] = " Errore! In modalità tastatura avanzata, file Dat mancante: %s"
EgtDoorsMsg[632] = " Errore! La lavorazione dei fianchi della porta non è compatibile con la tastatura completa. Disabilitare la lavorazione dei fianchi porta"
EgtDoorsMsg[633] = " Errore nella disposizione barra mobile: La larghezza porta è superiore o inferiore per l'ampiezza barre consentita. Controllare la larghezza porta"
EgtDoorsMsg[634] = " Impossibile inserire la Groove: %s. La cava è a filo o sborda dal lato dove è applicato il groove.\n Verificare il file ddf e il file %s"
EgtDoorsMsg[635] = " il DDF non ha nessun parametro: Properties"
EgtDoorsMsg[636] = " Errore! la proprietà narrow stile è compatibile solo con profilo diritto"
EgtDoorsMsg[637] = " Errore nella lettura Profili: codice profilo mancante. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[638] = "con nome: "
EgtDoorsMsg[639] = " Attenzione! Errato settaggio nella tabella ordinamenti (MTable). Nome geometria %s e' nel gruppo 0.\n"
EgtDoorsMsg[640] = " Errore! File del Post processor non definito. Controllare il parametro CompoMachining nel file CurrCamInfo.lua"
EgtDoorsMsg[641] = " Errore! Nome Macchina non corrispondente. Controllare il nome macchina utilizzato nel file CurrCamInfo.lua e nella MTable"
EgtDoorsMsg[642] = " Profilo #%s Spessore: %s"
EgtDoorsMsg[643] = " Errore! Porta con profilo %s sul lato//i: %s e di spessore: %s non combina con la lista dei profili %s : %s"
EgtDoorsMsg[644] = "Inferiore"
EgtDoorsMsg[645] = " Nessuna Face Decoration trovata"
EgtDoorsMsg[646] = "Face Decoration"
EgtDoorsMsg[647] = " Errore! La lunghezza calcolata: %s sulle linee verticali è errata\n Verificare i parametri nel file: %s"
EgtDoorsMsg[648] = " Errore! La lunghezza calcolata: %s sulle linee orizzontali è errata\n Verificare i parametri nel file: %s"
EgtDoorsMsg[649] = " Errore! Il parametro offset (%s): %s + raggio utensile %s è troppo grande. Max valore: %s\n Verificare i parametri nel file: %s"
EgtDoorsMsg[650] = " Errore! Il parametro distanza di fianco (%s): %s + larghezza rettangolo (%s): %s + raggio utensile %s fanno sbordare la geometria dalla porta (larghezza)\n Verificare i parametri nel file: %s"
EgtDoorsMsg[651] = " Errore! Il parametro distanza di verticale (%s): %s + altezza rettangolo (%s): %s + raggio utensile %s fanno sbordare la geometria dalla porta (altezza)\n Verificare i parametri nel file: %s"
EgtDoorsMsg[652] = " Errore! Il parametro distanza di fianco + passo linee + diametro utensile fanno sbordare la geometria dalla porta (larghezza)\n Verificare i parametri nel file: %s"
EgtDoorsMsg[653] = " Errore! Il parametro distanza di verticale + passo linee + diametro utensile fanno sbordare la geometria dalla porta (altezza)\n Verificare i parametri nel file: %s"
EgtDoorsMsg[654] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità braccio: %s perché è maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[655] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità corpo: %s perché è maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[656] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità braccio: %s perché è maggiore della massima lavorazione dell'utensile anti-scheggia: %s "
EgtDoorsMsg[657] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità corpo: %s perché è maggiore della massima lavorazione dell'utensile anti-scheggia: %s "
EgtDoorsMsg[658] = " Impossibile inserire il pivot: %s di tipo %s sottotipo %s, sul profilo cerniere di tipo Bevel: %s "
EgtDoorsMsg[659] = " Errore! In modalità tastatura avanzata, il settaggio opzionale .Pms differisce dal corrispondente parametro OPM nel file di tastatura: %s "
EgtDoorsMsg[660] = " Errore nella lettura Profili: parametro raggio e parametro angolo presenti contemporaneamente. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[661] = " Errore nella lettura Profili: parametro posizione X mancante. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[662] = " Errore nella lettura Profili: parametro posizione X ha valore maggiore delle larghezza porta. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[663] = " Errore nella lettura Profili: parametro Angolo maggiore di 45°. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[664] = " Errore nella lettura Profili: Parte top inclinata maggiore o uguale di altezza porta. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[665] = " Errore! Il parametro distanza di fianco (%s): %s - raggio utensile %s fanno sbordare la geometria dalla porta (larghezza)\n Verificare i parametri nel file: %s"
EgtDoorsMsg[666] = " Errore! Il parametro distanza di verticale (%s): %s - raggio utensile %s fanno sbordare la geometria dalla porta (altezza)\n Verificare i parametri nel file: %s"
EgtDoorsMsg[667] = " Errore! Porta con profili EdgeBreak %s sul lato//i: %s. La configurazione del profilo EdgeBreak è mancante. Inviare un feedback con la porta al vostro servizio di assistenza"
EgtDoorsMsg[668] = " il DDF non ha nessun parametro: Material"
EgtDoorsMsg[669] = " Impossibile inserire un pivot tipo intermediate: %s sul profilo cerniere tipo bullnose: %s "
EgtDoorsMsg[670] = " Attenzione! (%s) nel modello: %s è stata ridotta la profondità: %s perché è maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[671] = " Non è ammesso l'inserimento Roller (latch): %s sul lato serraturay con profilo tipo toro o concavo: %s. Verificare il file ddf "
EgtDoorsMsg[672] = " Attenzione! (%s) nel modello: %s è stata disabilitata la lavorazione: %s perché lo spessore della sfinestratura: %s è uguale o maggiore della massima lavorazione dell'utensile: %s "
EgtDoorsMsg[673] = " Attenzione! (%s) nel modello: %s è stata disabilitata la lavorazione di lama: %s perché una o entrambe le dimensioni della sfinestratura sono inferiori alla minima lunghezza del taglio lama "
EgtDoorsMsg[674] = " Attenzione! (%s) nel modello: %s non è stata disabilitata la lavorazione di lama perché lo spessore della sfinestratura: %s è maggiore della massima lavorazione impostata nel parametro lua : %s "
EgtDoorsMsg[675] = " Disposizione per Multiax-C1016 :"
EgtDoorsMsg[676] = " Disposizione per Multiax NE :"
EgtDoorsMsg[677] = " Errore! Impossibile creare superfici laterali. Verificare il file ddf"
EgtDoorsMsg[678] = " Errore! parte superiore ad arco in tangenza bordo destro ma i loro profili non corrispondono: %s, %s Verificare il file ddf "
EgtDoorsMsg[679] = " Errore! parte superiore ad arco in tangenza bordo sinistro ma i loro profili non corrispondono: %s, %s Verificare il file ddf "
EgtDoorsMsg[680] = " Errore nella lettura Profili: Le impostazioni dell'arco annullano la lunghezza di un lato. Verificare i parametri dell'arco (nel file ddf) "
EgtDoorsMsg[681] = " Attenzione! (%s) nel modello: %s del pezzo: %s il parametro %s di valore %s è stato ridotto a: %s perché è prossimo o maggiore dello spessore pezzo: %s "
EgtDoorsMsg[682] = " Errore nel settaggio tavola. Verificare i parametri nNumTableOnMachine e nNumTableForOtherMaterial nel file CurrcamInfo.lua"
EgtDoorsMsg[683] = " Errore in disposizione morse: insufficienti morse attive. Verificare le lavorazioni in prossimità delle morse"
EgtDoorsMsg[684] = " Errore in disposizione morse: troppe morse disattivate sulla parte destra. Verificare le lavorazioni in prossimità delle morse"
EgtDoorsMsg[685] = " Errore in disposizione morse: troppe morse disattivate nella parte sinistra. Verificare le lavorazioni in prossimità delle morse"
EgtDoorsMsg[686] = " Errore inizializzazione simulazione: %s"
EgtDoorsMsg[687] = " Rilevata colisione testa-pezzo. Verificare nella simulazione: %s"
EgtDoorsMsg[688] = " Extracorsa su asse: %s"
EgtDoorsMsg[689] = " Errore Generale (contattare l'assistenza): %s"
EgtDoorsMsg[690] = " Errore in simulazione. Il codice Cn non è stato generato"
EgtDoorsMsg[691] = " Attenzione! Il file %s é una vecchia versione ddf. Si prega di aprirlo nel EgtDoorCreator e fare clck su salva"
EgtDoorsMsg[692] = " Errore! la Mtable: %s presente nelle note del pezzo non è stata trovata nella configurazione EgtDoor corrente: %s. Probabilmente il ddf corrente è stato creato con un'altra configurazione EgtDoor"
EgtDoorsMsg[693] = " Errore! Il percorso della Mtable: %s presente nelle note del pezzo non corrisponde con il percorso della configurazione EgtDoor corrente: %s. Probabilmente il ddf corrente è stato creato con un'altra configurazione EgtDoor"
EgtDoorsMsg[694] = " Errore! Nessun pezzo o pezzo non salvato nel progetto corrente"
EgtDoorsMsg[695] = " Errore! Esiste più di un taglio di separazione longitudinale o trasversale"
EgtDoorsMsg[696] = "Porta larga ruotata, "
EgtDoorsMsg[697] = "Porta larga, "
EgtDoorsMsg[698] = " Attenzione! (%s) nel modello: %s è stata disabilitata la lavorazione: %s perché lo spessore profilo utensile: %s è uguale o maggiore dello spessore porta: %s"
EgtDoorsMsg[699] = " Il parametro %s: %s deve essere minore dello spessore porta: %s\n Verificare i parametri nel file: %s "
EgtDoorsMsg[700] = " Errore! Il percorso Side Groove arriva troppo vicino all'angolo: %s che ha una distanza minima di sicurezza: %s. Aumentare la distanza max dall'angolo o ridurre la lunghezza gola"
EgtDoorsMsg[701] = " Errore importazione o apertura file dxf: %s. Verificare che file dxf esista e non sia danneggiato"
EgtDoorsMsg[702] = " Errore! Formato file ddf non corrisponde con la sua versione: %s"
EgtDoorsMsg[703] = " Errore DDF versione: %s nella lettura Profili: codice profilo mancante. Verificare il file ddf in prossimità della linea: %s "
EgtDoorsMsg[704] = " Errore! elementi residui: %s. Concatenamento fallito"
EgtDoorsMsg[705] = " Errore! Concatenamento fallito: %s"
EgtDoorsMsg[706] = " Errore! Tipo di file importato non corrisponde al formato dxf"
EgtDoorsMsg[707] = " Errore! Impossibile aprire il file dxf"
EgtDoorsMsg[708] = " Percorso %s non ricostruito"
EgtDoorsMsg[709] = " Layer lato %s non trovato"
EgtDoorsMsg[710] = " Note mancanti"
EgtDoorsMsg[711] = " Note swing mancanti"
EgtDoorsMsg[712] = " Layer Notes non contiene percorso con informazioni necessarie"
EgtDoorsMsg[713] = " Trovato Errore nelle lavorazioni: %s"
EgtDoorsMsg[714] = " Errore nella generazione lavorazioni. Il codice Cn non è stato generato"
else -- default 'ENG'
EgtDoorsMsg[400] = " Tool Diameter %s: %s must be equal or bigger than: %s. Check the tool data "
EgtDoorsMsg[401] = " Parameter %s: %s must be bigger than 0\n Check the parameter into file: %s "
EgtDoorsMsg[402] = " Parameter %s: %s must be bigger than tool diameter(%s): %s\n Check the tool data or parameter into file: %s "
EgtDoorsMsg[403] = " Parameter %s: %s must be between the values min: %s max: %s\n Check the parameter into file: %s "
EgtDoorsMsg[404] = " Parameter %s: %s must be bigger or equal than 0\n Check the parameter into file: %s "
EgtDoorsMsg[405] = " Parameter %s: %s must be bigger or equal than tool diameter: %s\n Check the tool data or parameter into file: %s "
EgtDoorsMsg[406] = " Parameter %s: %s must be smaller than parameter %s: %s\n Check the parameters into file: %s "
EgtDoorsMsg[407] = " Parameter %s: %s must be bigger than parameter %s: %s\n Check the parameters into file: %s "
EgtDoorsMsg[408] = " Error! The dimension parameters are missing L and W or R into ddf"
EgtDoorsMsg[409] = " Interax parameter %s: %s must be bigger than handle diameter bore: %s\n Check the parameters into file: %s"
EgtDoorsMsg[410] = " Parameter %s: %s must be bigger or equal than %s+%s: %s\n Check the parameters into file: %s"
EgtDoorsMsg[411] = " Error! Unrecognized file (lua or nge type): %s\n Verify parameters into file: %s "
EgtDoorsMsg[412] = " Error! Impossible to import custom geometry file: %s. Verify the nge file "
EgtDoorsMsg[413] = " Error! Geometry: %s of %s: %s, has unknow SideDoor note: %s\n Check the imported nge file loaded into ddf: %s "
EgtDoorsMsg[414] = " Error! Geometry: %s of %s: %s, has not specified the SideDoor note\n Check the imported nge file loaded into ddf: %s "
EgtDoorsMsg[415] = " Error! Geometry: %s of %s has unknow InserPoint note: %s\n Check the imported nge file loaded into ddf: %s "
EgtDoorsMsg[416] = " Error! Geometry: %s of %s has not specified the InserPoint note\n Check the imported nge file loaded into ddf: %s "
EgtDoorsMsg[417] = " Parameter %s: %s Can have only theese values: 0 or 1 or -1\n Check the parameter into file: %s "
EgtDoorsMsg[418] = " Error! Geometry: %s of Viewer: %s, has unknow SideDoor note: %s\n Check the imported nge file loaded into ddf: %s "
EgtDoorsMsg[419] = " Error! Geometry: %s of Viewer: %s, has not specified the SideDoor note\n Check the imported nge file loaded into ddf: %s "
EgtDoorsMsg[420] = " Interax parameter %s: %s must be bigger than viewer diameter bore: %s\n Check the parameter into file: %s "
EgtDoorsMsg[421] = " Error! The dimension parameters are missing L and W or R\n Check the parameters into file: %s"
EgtDoorsMsg[422] = " Parameter %s: %s must be bigger or equal than parameter %s: %s\n Check the parameter into file: %s "
EgtDoorsMsg[423] = " Parameter %s: %s is too big and mortise overflow from face. Max value: %s\n Check the parameter into file: %s "
EgtDoorsMsg[424] = " Parameter %s: %s is too small and mortise overflow into face. Min value: %s\n Check the parameter into file: %s "
EgtDoorsMsg[425] = " Cant join the reverse poketing paths\n Please send the ddf file and the file %s to your assistance service "
EgtDoorsMsg[426] = " Cant join the poketing paths\n Please send the ddf file and the file %s to your assistance service "
EgtDoorsMsg[427] = " Cant make the composite path\n Please send the ddf file and the file %s to your assistance service "
EgtDoorsMsg[428] = " Insert a Mortise hinge: %s on bullnose-convex profile hinge edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[429] = " Insert a Concealed hinge: %s on bevel, or bullnose, or concave hinge edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[430] = " Insert a Lock: %s on Bullnose-convex profile lock edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[431] = " Insert an Edge Pull: %s on Bullnose-convex profile lock edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[432] = " Impossible to apply Over Head Arm: %s. Parameter H: %s is bigger or equal than door thickness: %s. Check ddf file and file %s"
EgtDoorsMsg[433] = " Door thickness %s is bigger than profile %s with radius: %s. Check ddf file"
EgtDoorsMsg[434] = " Opening error ddf file. Check ddf file if it exists and it is not damaged"
EgtDoorsMsg[435] = " Error reading Measures. Check ddf file near line: %s "
EgtDoorsMsg[436] = " Error reading Code. Check ddf file near line: %s "
EgtDoorsMsg[437] = " Error reading Order. Check ddf file near line: %s "
EgtDoorsMsg[438] = " Error reading Date. Check ddf file near line: %s "
EgtDoorsMsg[439] = " Error reading Size. Check ddf file near line: %s "
EgtDoorsMsg[440] = " Error reading Swing: %s. Check ddf file near line: %s "
EgtDoorsMsg[441] = " Error reading Profiles: missing overmaterial parameter. Check ddf file near line: %s "
EgtDoorsMsg[442] = " This door has no VisionCutOuts"
EgtDoorsMsg[443] = " This door has no LouverCutOuts"
EgtDoorsMsg[444] = " This door has no MailSlots"
EgtDoorsMsg[445] = " This door has no Viewers"
EgtDoorsMsg[446] = " This door has no Flush Pull"
EgtDoorsMsg[447] = " This door has no Hinges"
EgtDoorsMsg[448] = " This door has no Locks"
EgtDoorsMsg[449] = " This door has no Flush Bolts"
EgtDoorsMsg[450] = " This door has no Edge Pulls"
EgtDoorsMsg[451] = " This door has no Roller Latchs"
EgtDoorsMsg[452] = " This door has no Pivots"
EgtDoorsMsg[453] = " This door has no Stops And Closers"
EgtDoorsMsg[454] = " Error creating Door. Check ddf file "
EgtDoorsMsg[455] = " Error machining Door. Check ddf file, check machining and tools "
EgtDoorsMsg[456] = " Parameter %s: %s must be smaller or equal than parameter %s: %s\n Check the parameters into file: %s "
EgtDoorsMsg[457] = " Impossible to load custom geometry file: %s. Verify the nge file "
EgtDoorsMsg[458] = " Error. Kind of hardware: %s is allowed only on inactive door. actual door type: %s. Check ddf file "
EgtDoorsMsg[459] = " Parameter %s: %s must be bigger than 0 and must be smaller or equal than tool diameter: %s\n Check the tool data or parameter into file: %s "
EgtDoorsMsg[460] = " Warning! (%s) Into model: %s face depth: %s is modified because it's bigger than tool max depth parameter: %s "
EgtDoorsMsg[461] = " Warning! (%s) Into model: %s mortise depth: %s is modified because it's bigger than tool max depth parameter: %s "
EgtDoorsMsg[462] = " Warning! (%s) into model: %s face depth: %s is modified because it's bigger than anti splint tool max depth parameter: %s "
EgtDoorsMsg[463] = " Warning! (%s) Into model: %s bore depth: %s is modified because it's bigger than tool max depth parameter: %s "
EgtDoorsMsg[464] = " Impossible to apply Center Hung Pivot: %s on Bevel profile hinge edge: %s "
EgtDoorsMsg[465] = " Impossible to apply intermediate pivot: %s on Bullnose-convex profile hinge edge: %s "
EgtDoorsMsg[466] = " Warning! (%s) No machining with index: %s linked to geometry name: %s\n Will be used the tool diameter defined into model: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[467] = " Warning! (%s) Impossible to set machining: %s with index: %s to geometry name: %s\n Will be used the tool diameter defined into model: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[468] = " Warning! (%s) Impossible to acquire data from machining: %s with index: %s applied to geometry name: %s\n Verify the machining \n Will be used the tool diameter defined into model: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[469] = " Warning! (%s) Impossible to acquire tool data from machining: %s with index: %s applied to geometry name: %s\n Verify the machining \n Will be used the tool diameter defined into model: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[470] = " Warning! (%s) Impossible to acquire diameter tool data from machining: %s with index: %s applied to geometry name: %s\n Verify tool data \n Will be used the tool diameter defined into model: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[471] = " Warning! (%s) Geometry name: %s not found or disabled in MTable \n Check the MTable \n Will be used the tool diameter: %s defined into model\n No depth correction will be checked and applied"
EgtDoorsMsg[472] = " Warning! (%s) Impossible to acquire max material tool data from machining: %s with index: %s applied to geometry name: %s\n Verify tool data \n Will be used the tool diameter defined into model: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[473] = " Warning! (%s) Impossible to acquire max material tool data from machining: %s with index: %s applied to geometry name: %s\n Verify tool data \n No depth correction will be checked and applied"
EgtDoorsMsg[474] = " Error positioning raw part on table"
EgtDoorsMsg[475] = " Error on machining calculation of machine: %s The code for this machine will not generated"
EgtDoorsMsg[476] = "Error"
EgtDoorsMsg[477] = "ERROR"
EgtDoorsMsg[478] = " Error on Nc part program calculation of machine: %s. Verify if all used tools are loaded into setup: %s"
EgtDoorsMsg[479] = "Door flipped: Secure on top"
EgtDoorsMsg[480] = "Door normal: Keyway on top"
EgtDoorsMsg[481] = ", Top on right"
EgtDoorsMsg[482] = ", Top on left"
EgtDoorsMsg[483] = " Null or undefined machining apply to geometry: %s Id geom: %s Check MTable\n"
EgtDoorsMsg[484] = " Error! Invalid or not exists machining: %s (applied to geometry: %s Id geom:%s)\n Check MTable or MachDb"
EgtDoorsMsg[485] = " Error! Impossible to insert or to apply the machining: %s to geometry: %s Id geom: %s\n Check machining and geometry"
EgtDoorsMsg[486] = "Error on load Cam data from file: %s"
EgtDoorsMsg[487] = "Error! %sfile: %s not found or not loadable"
EgtDoorsMsg[488] = "Warning! Machine: %s not found"
EgtDoorsMsg[489] = "Error! Invalid machine data ino table file: %s"
EgtDoorsMsg[490] = "Error! Invalid MTable into file: %s"
EgtDoorsMsg[491] = "Error! Machine name: %s not found into table"
EgtDoorsMsg[492] = " Warning! NC generation on machine: %s is disabled by MTable settings"
EgtDoorsMsg[493] = "\n No machining for machine: %s piece number: %s piece name: %s"
EgtDoorsMsg[494] = " Start Machining on machine: %s"
EgtDoorsMsg[495] = "Door Disposition"
EgtDoorsMsg[496] = " on geometry name (number): "
EgtDoorsMsg[497] = " Skipped geom Id: "
EgtDoorsMsg[498] = "End of machining generation "
EgtDoorsMsg[499] = " Warning! MTable reference not found into current project"
EgtDoorsMsg[500] = " Warning! Non Inactive door with opposite bevel profile. Swing: %s Hinge prof.: %s Lock prof.: %s"
EgtDoorsMsg[501] = "Warning"
EgtDoorsMsg[502] = "WARNING"
EgtDoorsMsg[503] = " Warning! (%s) Geometry name: %s not found or disabled in MTable \n Check the MTable \n No depth correction will be checked and applied"
EgtDoorsMsg[504] = " Warning! (%s) No machining with index: %s linked to geometry name: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[505] = " Warning! (%s) Impossible to set machining: %s with index: %s to geometry name: %s\n No depth correction will be checked and applied"
EgtDoorsMsg[506] = " Warning! (%s) Impossible to aquire data from machining: %s with index: %s applied to geometry name: %s\n Verify the machining \n No depth correction will be checked and applied"
EgtDoorsMsg[507] = " Warning! (%s) Impossible to acquire tool data from machining: %s with index: %s applied to geometry name: %s\n Verify the machining \n No depth correction will be checked and applied"
EgtDoorsMsg[508] = " Warning! (%s) Impossible to acquire diameter tool data from machining: %s with index: %s applied to geometry name: %s\n Verify tool data \n No depth correction will be checked and applied"
EgtDoorsMsg[509] = " Warning! (%s) MTable not found into project notes\n Check the project \n No diameter tool and depth correction will be checked and applied"
EgtDoorsMsg[510] = ", Add Spacer on Y"
EgtDoorsMsg[511] = "Disp"
EgtDoorsMsg[512] = "Invalid parameters into ddf file near line: %s on feature: %s"
EgtDoorsMsg[513] = "Vision cutout"
EgtDoorsMsg[514] = "Louver cutout"
EgtDoorsMsg[515] = "Mail slot"
EgtDoorsMsg[516] = "Viewer"
EgtDoorsMsg[517] = "Flush pull"
EgtDoorsMsg[518] = "Hinge"
EgtDoorsMsg[519] = "Lock"
EgtDoorsMsg[520] = "FlushBolt"
EgtDoorsMsg[521] = "EdgePull"
EgtDoorsMsg[522] = "Roller latch"
EgtDoorsMsg[523] = "Pivot"
EgtDoorsMsg[524] = "StopAndCloser"
EgtDoorsMsg[525] = "Over Head Stop_Closer"
EgtDoorsMsg[526] = " This door has no Over Heads"
EgtDoorsMsg[527] = " Parameter %s: %s is too big and bore overflow from face. Max value: %s\n Check the parameter into file: %s "
EgtDoorsMsg[528] = " Disposition for Cms-PF122R8RR :"
EgtDoorsMsg[529] = " Disposition for Multiax-N1216 :"
EgtDoorsMsg[530] = " Error on MOBILE or FIXED table bar"
EgtDoorsMsg[531] = " Error on vacuum disposition: the active vacuums are not enought. Check the cutout geometries or hardware machinings near vacuums"
EgtDoorsMsg[532] = " Error on vacuum disposition: too many disabled vacuums on left side door. Check the cutout geometries or hardware machinings near vacuums"
EgtDoorsMsg[533] = " Error on vacuum disposition: too many disabled vacuums on middle door. Check the cutout geometries or hardware machinings near vacuums"
EgtDoorsMsg[534] = " Error on vacuum disposition: too many disabled vacuums on right side door. Check the cutout geometries or hardware machinings near vacuums"
EgtDoorsMsg[535] = " This door has no Strikes"
EgtDoorsMsg[536] = " This door has no Groove"
EgtDoorsMsg[537] = " This door has no Rabbet"
EgtDoorsMsg[538] = "Strike"
EgtDoorsMsg[539] = "Groove"
EgtDoorsMsg[540] = " Impossible to apply Groove: %s. Parameter H: %s is bigger or equal than door thickness: %s\n Check ddf file and file %s"
EgtDoorsMsg[541] = " Warning! (%s) into model: %s anti split path depth: %s is modified because it's bigger than anti splint tool max depth parameter: %s "
EgtDoorsMsg[542] = " Warning! (%s) Into model: %s groove width: %s it's smaller than blade thickness: %s "
EgtDoorsMsg[543] = " This DDF file has no Secure parameter"
EgtDoorsMsg[544] = " Error! definition door parameters conflicting. Swing: %s DDF bevel profile: %s SECURE parameter: %s. Check ddf file"
EgtDoorsMsg[545] = " Error! Missing definition door parameters. DDF bevel profile not found and DDF SECURE parameter not found. Check ddf file"
EgtDoorsMsg[546] = " Insert a Rabbet on bullnose-convex profile hinge edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[547] = " Insert a Rabbet on bullnose-convex profile lock edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[548] = " Error! Parameter side of rabbet is not allowed: %s. Check ddf file "
EgtDoorsMsg[549] = " Warning! (%s) Into model: %s rail depth: %s is modified because it's bigger than tool max depth parameter: %s "
EgtDoorsMsg[550] = "Rabbet"
EgtDoorsMsg[551] = " Error on import all setup tool fle\n Check into SETUP section if exists setup file and if they are defined into CurrCamInfo.lua file"
EgtDoorsMsg[552] = " Error into Setup tool file: %s"
EgtDoorsMsg[553] = " List of not loaded tools and/or missing tool: "
EgtDoorsMsg[554] = " Setup file empty or not loaded: %s"
EgtDoorsMsg[555] = "none"
EgtDoorsMsg[556] = " Warning! (%s) Into model: %s face depth: %s is modified because it's bigger than chisel tool max depth parameter: %s "
EgtDoorsMsg[557] = " This door has no EPT"
EgtDoorsMsg[588] = "EPT"
EgtDoorsMsg[589] = " Insert an EPT: %s on bullnose-convex profile hinge edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[590] = " Error! Missing definition door parameters. This Door without bevel profile, Not found SECURE parameter from DDF and not found from CurrCamInfo file"
EgtDoorsMsg[591] = " Error! Parameter: %s not defined or Type parameter into DDF not suitable. Check the template file: %s or the Type parameter into door ddf file"
EgtDoorsMsg[592] = " Error! Parameter: %s not defined. Verify the door ddf file"
EgtDoorsMsg[593] = " Warning! %s can be applied only on %s side. Check ddf file"
EgtDoorsMsg[594] = " Error! %s can't be applied on side %s. Check ddf file"
EgtDoorsMsg[595] = " machining: "
EgtDoorsMsg[596] = " phase: "
EgtDoorsMsg[597] = " Error! Table file not found: %s "
EgtDoorsMsg[598] = " Error! Impossible to insert or to apply the machining: %s to geometry: %s Id geom: %s\n Error Id: %s Error: %s\n Check machining and geometry"
EgtDoorsMsg[599] = " No door found"
EgtDoorsMsg[600] = " No second door found"
EgtDoorsMsg[601] = " No Left frame found"
EgtDoorsMsg[602] = " No Right frame found"
EgtDoorsMsg[603] = " No Top frame found"
EgtDoorsMsg[604] = " Error! Hardware model out of sequence. Check ddf file near line: %s "
EgtDoorsMsg[605] = "Side Left"
EgtDoorsMsg[606] = "Side Right"
EgtDoorsMsg[607] = "Side Top"
EgtDoorsMsg[608] = "Sill"
EgtDoorsMsg[609] = " Error! definition jamb parameters conflicting. Jamb piece: %s Kind of jamb: %s Lock side on: %s. Check ddf file"
EgtDoorsMsg[610] = "Jamb flipped: Secure on top"
EgtDoorsMsg[611] = "Jamb normal: Keyway on top"
EgtDoorsMsg[612] = " Warning! (%s) into model: %s clean corner path depth: %s is modified because it's deepher than clean corner tool max depth parameter: %s "
EgtDoorsMsg[613] = " Error reading Profiles: missing radius or angle parameter. Check ddf file near line: %s "
EgtDoorsMsg[614] = " Error reading Profiles: radius value is too small. Check ddf file near line: %s "
EgtDoorsMsg[615] = " Error reading Profiles: side profiles not correspond to arc profile. Check ddf file near line: %s "
EgtDoorsMsg[616] = " Error! Piece (%s) height is bigger. Height %s + overmaterial %s: %s is bigger than max piece height configured minus X shift value %s: %s (limit into CurrCamInfo file)."
EgtDoorsMsg[617] = " Error! Piece (%s) height is smaller. Height %s + overmaterial %s: %s is less than min piece height configured minus X shift value %s: %s (limit into CurrCamInfo file)."
EgtDoorsMsg[618] = " Error! Piece (%s) width is bigger. Width %s + double overmaterial %s: %s is bigger than max piece width configured minus Y shift value %s: %s (limit into CurrCamInfo file)."
EgtDoorsMsg[619] = " Error! Piece (%s) width is smaller. Width %s + double overmaterial %s: %s is less than min piece width configured minus Y shift value %s: %s (limit into CurrCamInfo file)."
EgtDoorsMsg[620] = " Error! Piece (%s) thickness: %s is bigger than max piece thickness configured: %s (limit into CurrCamInfo file)."
EgtDoorsMsg[621] = " Error! Piece (%s) thickness: %s is less than min piece thickness configured: %s (limit into CurrCamInfo file)."
EgtDoorsMsg[622] = " Door"
EgtDoorsMsg[623] = " Jamb"
EgtDoorsMsg[624] = " Parameter %s: %s is too big and 2nd mortise overflow from 1st mortise. Max value: %s\n Check the parameter into file: %s "
EgtDoorsMsg[625] = " Parameter %s: %s is too small and 2nd mortise overflow into 1st mortise. Min value: %s\n Check the parameter into file: %s "
EgtDoorsMsg[626] = " Parameter %s: %s is too big. Max value: %s\n Check the parameter into file: %s "
EgtDoorsMsg[627] = " Parameter %s: %s is too small. Min value: %s\n Check the parameter into file: %s "
EgtDoorsMsg[628] = " Error! It is not possible manage Top arc door with full probe function"
EgtDoorsMsg[629] = " Error! Door dimensions probed H=%s W=%s T=%s exceded than tolerance DGC.Dh=%s DGC.Dw=%s DGC.Dt=%s from DDF dimensions H=%s W=%s T=%s. Check Door on machine"
EgtDoorsMsg[630] = " Error creating Door. Check Piece Dimension on machine"
EgtDoorsMsg[631] = " Error! By advanced probe mode, Dat file is missing: %s"
EgtDoorsMsg[632] = " Error! Trim of door sides is not compatible with total probe mode. Please disable the side trim."
EgtDoorsMsg[633] = " Error on bar disposition: The door is bigger or smaller than for table disposition. Check the door wide dimension"
EgtDoorsMsg[634] = " Impossible to apply Groove: %s. Groove geometry correspond or overlap to the applied side.\n Check ddf file and file %s"
EgtDoorsMsg[635] = " This DDF file has no Properties parameter"
EgtDoorsMsg[636] = " Error! Narrow stile property is compatible only with square profile"
EgtDoorsMsg[637] = " Error reading Profiles: profile code missing. Check ddf file near line: %s "
EgtDoorsMsg[638] = "whith name: "
EgtDoorsMsg[639] = " Warning! Wrong Ordered table(Mtable table) setting. Geometry name: %s is on group 0.\n"
EgtDoorsMsg[640] = " Error! Post processor file not defined. Check parameter CompoMachining into CurrCamInfo.lua file"
EgtDoorsMsg[641] = " Error! Machine name mismatch. Check used machine into CurrCamInfo.lua file and MTable"
EgtDoorsMsg[642] = " Prof #%s thickness: %s"
EgtDoorsMsg[643] = " Error! Door with profile %s on: %s and thickness: %s not match with the configured %s list: %s"
EgtDoorsMsg[644] = "Side Bottom"
EgtDoorsMsg[645] = " This door has no Face Decoration"
EgtDoorsMsg[646] = "Face Decoration"
EgtDoorsMsg[647] = " Error! The calculated length %s of vertical lines is bad\n Check the parameters into file: %s"
EgtDoorsMsg[648] = " Error! The calculated length %s of horizontal lines is bad\n Check the parameters into file: %s"
EgtDoorsMsg[649] = " Error! The offset parameter (%s): %s + tool radius %s is too big. Max value: %s\n Check the parameters into file: %s"
EgtDoorsMsg[650] = " Error! The side distance parameter (%s): %s + rectangle width (%s): %s + tool radius %s protrudes off some geometries than door width\n Check the parameters into file: %s"
EgtDoorsMsg[651] = " Error! The vertical distance parameter (%s): %s + rectangle length (%s): %s + tool radius %s protrude off some geometries than door height\n Check the parameters into file: %s"
EgtDoorsMsg[652] = " Error! The side distance parameter + lines step + tool diameter protrude off some geometries than door width\n Check the parameters into file: %s"
EgtDoorsMsg[653] = " Error! The vertical distance parameter + lines step + tool diameter protrude off some geometries than door height\n Check the parameters into file: %s"
EgtDoorsMsg[654] = " Warning! (%s) Into model: %s knuckle depth: %s is modified because it's bigger than tool max depth parameter: %s "
EgtDoorsMsg[655] = " Warning! (%s) Into model: %s body depth: %s is modified because it's bigger than tool max depth parameter: %s "
EgtDoorsMsg[656] = " Warning! (%s) into model: %s knuckle depth: %s is modified because it's bigger than anti splint tool max depth parameter: %s "
EgtDoorsMsg[657] = " Warning! (%s) into model: %s body depth: %s is modified because it's bigger than anti splint tool max depth parameter: %s "
EgtDoorsMsg[658] = " Impossible apply the Pivot: %s type %s subtype %s, on a Bevel hinge profile: %s "
EgtDoorsMsg[659] = " Error! By advanced probe mode, optional setting .Pms not match the parameter OPM into probe file: %s "
EgtDoorsMsg[660] = " Error reading Profiles: radius parameter and angle parameter cannot be together. Check ddf file near line: %s "
EgtDoorsMsg[661] = " Error reading Profiles: X pos. parameter missing. Check ddf file near line: %s "
EgtDoorsMsg[662] = " Error reading Profiles: X pos. parameter is bigger than door width. Check ddf file near line: %s "
EgtDoorsMsg[663] = " Error reading Profiles: Angle parameter is bigger than 45°. Check ddf file near line: %s "
EgtDoorsMsg[664] = " Error reading Profiles: Inclinated top side is bigger or equal than door height. Check ddf file near line: %s "
EgtDoorsMsg[665] = " Error! The side distance parameter (%s): %s - tool radius %s protrudes off some geometries than door width\n Check the parameters into file: %s"
EgtDoorsMsg[666] = " Error! The vertical distance parameter (%s): %s - tool radius %s protrude off some geometries than door height\n Check the parameters into file: %s"
EgtDoorsMsg[667] = " Error! found Door with EdgeBreak profile %s on: %s. But EdgeBreak profile data is not configured into CurrDoorsCustomData. Please send a feedback with this door to your assistance service"
EgtDoorsMsg[668] = " This DDF file has no Material parameter"
EgtDoorsMsg[669] = " Impossible to apply intermediate pivot: %s on Bullnose profile hinge edge: %s "
EgtDoorsMsg[670] = " Warning! (%s) Into model: %s its depth: %s is modified because it's bigger than tool max material parameter: %s "
EgtDoorsMsg[671] = " Insert a Roller (latch): %s on bullnose-convex profile lock edge: %s is not allowed. Check ddf file "
EgtDoorsMsg[672] = " Warning! (%s) Into model: %s machining: %s is disabled because lightcutout thickness: %s it's equal or bigger than tool max depth parameter: %s "
EgtDoorsMsg[673] = " Warning! (%s) Into model: %s machining: %s is disabled because one or both lightcutout dimension are smaller than min. blade cut "
EgtDoorsMsg[674] = " Warning! (%s) Into model: %s machining by blade is disabled because lightcutout thickness: %s it's bigger than lua max depth parameter: %s "
EgtDoorsMsg[675] = " Disposition for Multiax-C1016 :"
EgtDoorsMsg[676] = " Disposition for Multiax-NE :"
EgtDoorsMsg[677] = " Error! It's not possible make side surfaces. Check ddf file"
EgtDoorsMsg[678] = " Error! Top Arc tangent to right side but their profiles does not match: %s, %s Check ddf file "
EgtDoorsMsg[679] = " Error! Top Arc tangent to left side but their profiles does not match: %s, %s Check ddf file "
EgtDoorsMsg[680] = " Error reading Profiles: radius parameters of top side arc makes the length of one side null. Check Top Arc parameters (into ddf file)"
EgtDoorsMsg[681] = " Warning! (%s) Into model: %s of piece: %s the parameter %s value %s is modified to: %s because it's bigger or near than jamb thickness: %s "
EgtDoorsMsg[682] = " Error in table setting. Verify the parameters nNumTableOnMachine and nNumTableForOtherMaterial into CurrcamInfo.lua file"
EgtDoorsMsg[683] = " Error on vise disposition: the active vises are not enought. Check the hardware machinings near vises"
EgtDoorsMsg[684] = " Error on vise disposition: too many disabled vises on left side frame. Check the hardware machinings near vises"
EgtDoorsMsg[685] = " Error on vise disposition: too many disabled vises on right side frame. Check the hardware machinings near vises"
EgtDoorsMsg[686] = " Error starting simulation: %s"
EgtDoorsMsg[687] = " Head-part collision detected. Check it by simulation: %s"
EgtDoorsMsg[688] = " Axis outstroke: %s"
EgtDoorsMsg[689] = " General failure (contact supplier): %s"
EgtDoorsMsg[690] = " Error on simulation. The part program is not generated"
EgtDoorsMsg[691] = " Attention! This ddf %s is too old. Please open it into EgtDoorCreator and just save it"
EgtDoorsMsg[692] = " Error! Mtable piece info: %s not found into current EgtDoor configuration: %s. Maybe this ddf file was made with another EgtDoor configuration."
EgtDoorsMsg[693] = " Error! Mtable path into piece info: %s not correspond to current EgtDoor configuration: %s. Maybe this ddf file was made with another EgtDoor configuration."
EgtDoorsMsg[694] = " Error! No Piece or not saved Piece to process into current project"
EgtDoorsMsg[695] = " Error! Exist more cuts along door Heigth or along door width"
EgtDoorsMsg[696] = "Wide spinned Door, "
EgtDoorsMsg[697] = "Wide Door, "
EgtDoorsMsg[698] = " Warning! (%s) Into model: %s machining: %s is disabled because tool thickness: %s is equal or bigger than door thichness: %s"
EgtDoorsMsg[699] = " Parameter %s: %s must be smaller than door thickness: %s\n Check the parameters into file: %s "
EgtDoorsMsg[700] = " Error! Side Groove path is too close to corner %s than min distance %s. Set bigger the max distance to corner or reduce the groove length"
EgtDoorsMsg[701] = " Importing or Opening error dxf file: %s. Check dxf file if it exists and it is not damaged"
EgtDoorsMsg[702] = " Error! DDF file format not correspond to DDF version number: %s"
EgtDoorsMsg[703] = " Error (with DDF version: %s) reading Profiles: profile code missing. Check ddf file near line: %s "
EgtDoorsMsg[704] = "Residual elements: %s. Chaining failed"
EgtDoorsMsg[705] = "Chaining failed: %s"
EgtDoorsMsg[706] = " Error! File format does not correspond to dxf format"
EgtDoorsMsg[707] = " Impossible open the dxf file"
EgtDoorsMsg[708] = "%s path not rebuild"
EgtDoorsMsg[709] = "Side %s layer not found"
EgtDoorsMsg[710] = " Missing notes"
EgtDoorsMsg[711] = " Swing notes missing"
EgtDoorsMsg[712] = " Notes layer has not a path with neded info"
EgtDoorsMsg[713] = " Machinings error found: %s"
EgtDoorsMsg[714] = " Error on machining generations. The part program is not generated"
end
return EgtDoorsMsg
+913
View File
@@ -0,0 +1,913 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- fc_rectangle.lua by EgalWare s.r.l. 2019.05.07
-- Autore: Filippo Monchi
-- fc_rectangle dati i valori 'Thickness' e 'face' e con nome attributo
-- 2019.05.07 V1.000 FM Write Component
-- 2019.09.24 V1.001 FM Manage side distance parameters (top, bottom, lock, hinge) from ddf
-- 2019.09.25 V1.002 FM Fix some error on calculate lines and rectangle position when diameter tool used
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.10.18 V2.000 FM Manage to draw not premptive lines between premptive lines only if premptive lines are 2 and their start and stop
-- distances are defined and without or zero step value
-- 2022.07.27 V2.001 FM Modification to use compiled code
-- 2023.05.15 V2.002 FM fix errors (x/0) when exists only 1 horizontal line and/or only 1 vertical line and both distances ( from reference and opposite sides) are difined
-- Tavola per definizione modulo (serve ma non usata)
local fc_rectangle = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Valori limite
local DimMin = 4. -- valore minimo lato
local function GetMachToolErrorMessage( nErrorId, sGeomName, dIdMach, dOriDiamTool, nIdLogErr, sMchngName)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local sMessage = ''
if dOriDiamTool then
if nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[466], nIdLogErr, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -2 then -- errore nel settare la lavorazione, lavorazione non presente in libreria
sMessage = string.format(EgtDoorsMsg[467], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[468], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[469], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[470], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[471], nIdLogErr, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[472], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
elseif nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[504], nIdLogErr, dIdMach, sGeomName)
elseif nErrorId == -2 then -- errore nel settare la lavorazione
sMessage = string.format(EgtDoorsMsg[505], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[506], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[507], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[508], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[503], nIdLogErr, sGeomName)
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[473], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
return sMessage
end
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
local nNumLine
if idTable then
table.insert( idTable, nLine)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumLine = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor(nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor(nCircle2, cColor2)
end
end
return nLine, nNumLine, sMVar
end
local function DrawAddCircleDrawCircle( pCenter, dRadius, dAngIni, dAngCen, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar)
local nCircle = EgtArc( nGroup, pCenter, dRadius, dAngIni, dAngCen, 0, GDB_RT.LOC)
local nNumCircle
if idTable then
table.insert( idTable, nCircle)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumCircle = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, EgtSP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, EgtEP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle2, cColor2)
end
end
return nCircle, nNumCircle, sMVar
end
local function DrawRectangleWithFillet ( Lg, L, H, dThickD, rf)
local tHint = {}
local hint
local pIni, pEnd, pCen
-- Costruzione della geometria principale
pIni = Point3d(((L/2)-rf),(H/2),dThickD)
pCen = Point3d(((L/2)-rf),((H/2)-rf),dThickD)
pEnd = Point3d((L/2),((H/2)-rf),dThickD)
DrawAddCircleDrawCircle( pCen, rf, 90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (H/2)) > GEO.EPS_SMALL then -- se c'è spazio per una linea tra i due raccordi
pEnd = Point3d((L/2),-(H/2)+rf,dThickD)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d(((L/2)-rf),(-(H/2)+rf),dThickD)
pEnd = Point3d(((L/2)-rf),-(H/2),dThickD)
DrawAddCircleDrawCircle( pCen, rf, 0,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (L/2)) > GEO.EPS_SMALL then -- se c'è stazio per una linea tra i due raccordi
pEnd = Point3d(-((L/2)-rf),-(H/2),dThickD)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d(-((L/2)-rf),(-(H/2)+rf),dThickD)
pEnd = Point3d(-(L/2),(-(H/2)+rf),dThickD)
DrawAddCircleDrawCircle( pCen, rf, -90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (H/2)) > GEO.EPS_SMALL then -- se c'è stazio per una linea tra i due raccordi
pEnd = Point3d(-(L/2),((H/2)-rf),dThickD)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d(-((L/2)-rf),((H/2)-rf),dThickD)
pEnd = Point3d(-((L/2)-rf),(H/2),dThickD)
DrawAddCircleDrawCircle( pCen, rf, 180,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (L/2)) > GEO.EPS_SMALL then -- se c'è spazio per una linea tra i due raccordi
pEnd = Point3d(((L/2)-rf),(H/2),dThickD)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
end
-- trasformo in geometria composita i/il percorsi/o di contorno
-- primo percorso
if ( #tHint > 0) then
hint = EgtCurveCompo( Lg, tHint, true)
if hint then
EgtInvertCurve( hint)
end
end
return hint
end
local function MakeRectWithFillet( Lg, P1, P2, Rf, Ang)
local hint_3 = EgtRectangle2P( Lg, P1, P2, GDB_RT.LOC)
if hint_3 then
local nNewId, nNumEnt = EgtExplodeCurveCompo( hint_3)
if nNewId and nNumEnt and nNumEnt > 0 then
local pStartIni
-- se devo inserire i raccordi
if Rf > 0 then
local tIdFil = {}
local nLine
for p = 1, (nNumEnt-1) do
nLine = EgtCurveFillet( Lg, ( nNewId + p - 1), EgtEP( nNewId + p - 1), ( nNewId + p), EgtSP( nNewId + p), Rf, true)
table.insert( tIdFil, nLine)
end
nLine = EgtCurveFillet( Lg, ( nNewId + nNumEnt - 1), EgtEP( nNewId + nNumEnt - 1), nNewId, EgtSP(nNewId), Rf, true)
table.insert( tIdFil, nLine)
-- creo curvecompo
pStartIni = EgtMP( nNewId)
hint_3 = EgtCurveCompo( Lg, { nNewId, tIdFil[1], (nNewId+1), tIdFil[2], (nNewId+2), tIdFil[3], (nNewId+3), tIdFil[4]}, true)
else
-- creo curvecompo
pStartIni = EgtMP( nNewId)
hint_3 = EgtCurveCompo( Lg, { nNewId, (nNewId+1), (nNewId+2), (nNewId+3)}, true)
end
if hint_3 then
EgtChangeClosedCurveStartPoint( hint_3, pStartIni, GDB_RT.LOC) -- cambio punto di inizio
if Ang ~= 0 then
EgtRotate( hint_3, EgtGP( hint_3), Z_AX(), Ang, GDB_RT.LOC) -- ruoto
end
end
end
end
return hint_3
end
-- Funzione di sistemazione parametri
function fc_rectangle.AdjustParams( tMhPar)
-- Assegno parametri da dati utensili in macchina
local MB = require( 'MachiningBase')
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local nTempT3
local dNumMessage
local dNumLog = 0
local sMessToOut = ''
local dMaxMat3
local sMchngName3
local sLGR
local nLGRi = 1
-- setto le variabili dimensioni porta
tMhPar.W = DGD.dW
tMhPar.L = DGD.dH
tMhPar.type = 2 -- 1: lines, 2: rectangle
-- variabile supporto calcolo offset
tMhPar.esfr = 0
-- nome geometria e diametri utensili delle associate lavorazioni
if tMhPar.LGR then
sLGR = tMhPar.LGR
if DGD.MachEn > 0 and tMhPar.d3 then nTempT3, dMaxMat3, sMchngName3 = MB.GetToolDataFromAttrib( sLGR, nLGRi) end
end
-- se devo disegnare le geometrie di lavorazione
if DGD.MachEn > 0 then
-- gestisco il risultato della lettura utensili
if DGD.bProoduce and tMhPar.d3 and nTempT3 <= 0 then
dNumLog = -2795
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT3, sLGR, nLGRi, tMhPar.d3, dNumLog, sMchngName3)
elseif nTempT3 then
tMhPar.d3 = nTempT3
end
end
-- se il diametro non è stato definito (dal controllo lavorazione)
if not tMhPar.d3 then tMhPar.d3 = 0 end
-- assegnamento valore a variabili di appoggio
if not tMhPar.ctr then -- se non devo considerare l'utensile
tMhPar.esfr = 0
else -- considero l'utensile
tMhPar.esfr = tMhPar.d3/2
end
if not tMhPar.rf then
tMhPar.rf = 0
else
tMhPar.rf = abs(tMhPar.rf)
end
if tMhPar.rf > 0 then -- se c'è raccordo disattivo gli sbordi
tMhPar.pre = nil
end
---------------------------------------
-- setto parametri da ddf
---------------------------------------
-- profondità
if DGD.DEPTH then
if tMhPar.Dhr then
tMhPar.Dhr = EgtIf( DGD.DEPTH >= DGD.dT, 0, DGD.DEPTH)
end
end
if DGD.DFT and DGD.DFT > 0 then -- se ho distanza top
tMhPar.tdr = DGD.DFT
end
if DGD.DFB and DGD.DFB > 0 then -- se ho distanza bottom
tMhPar.bdr = DGD.DFB
end
if DGD.DFL and DGD.DFL > 0 then -- se ho distanza lock
tMhPar.ldr = DGD.DFL
end
if DGD.DFH and DGD.DFH > 0 then -- se ho distanza hinge
tMhPar.hdr = DGD.DFH
end
if not tMhPar.clr then -- se non è definita la lunghezza di arresto
tMhPar.clr = -tMhPar.d3*0.75
else
tMhPar.clr = abs(tMhPar.clr)
end
if not tMhPar.cir then -- se non è definita la lunghezza di arresto alle intersezioni
tMhPar.cir = 0
else
tMhPar.cir = abs(tMhPar.cir)
end
-- se devo disegnare le geometrie di lavorazione
if DGD.MachEn > 0 then
-- se la profondità delle linee verticali è maggiore della capacita utensile limito la profondità ed emetto un warning
if tMhPar.Dhr and dMaxMat3 and tMhPar.Dhr > dMaxMat3 then
dNumLog = -2794
dNumMessage = 549
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.Dhr), EgtToUiUnits(dMaxMat3))
tMhPar.Dhr = dMaxMat3 - 0.02 -- tolgo 0.02 per permettere la lavorazione
end
end
if dNumLog ~= 0 then
return tMhPar, dNumLog, sMessToOut
end
return tMhPar, 0, ''
end
-- Funzione di disegno
function fc_rectangle.Draw( tFDecorPar, bPreview, bRunByCompo, nDrawMach)
-- Assegno le variabili per rettangolo
local Dhr = tFDecorPar.Dhr
local rty = tFDecorPar.rty
local ofr = tFDecorPar.ofr
local rer = tFDecorPar.rer
local tdr = tFDecorPar.tdr
local bdr = tFDecorPar.bdr
local ldr = tFDecorPar.ldr
local hdr = tFDecorPar.hdr
local rw = tFDecorPar.rw
local rl = tFDecorPar.rl
local rf = tFDecorPar.rf
local clr = tFDecorPar.clr
local cir = tFDecorPar.cir
local esfr = tFDecorPar.esfr
local d3 = tFDecorPar.d3
-- Assegno variabili comuni
local pre = tFDecorPar.pre
local dtype = tFDecorPar.type
local L = tFDecorPar.L
local W = tFDecorPar.W
-- Assegno i nomi geometrie
local LGR = tFDecorPar.LGR
local DM = 'DUMMY'
-- variabili per messaggi e settaggi vari
local sCompoName = tFDecorPar.Nome
local nCompoNpar = tFDecorPar.Npar
local sCompoPath = tFDecorPar.Path
-- eventuale messaggio errore rilevato nell'adjust
local nCodAdj = tFDecorPar.nCod
local sCodAdj = tFDecorPar.sCod
-- variabili per messaggi di errore
local sNamePar1 = 'rl'
local sNamePar2 = 'rw'
local sNamePar5 = 'Dhr'
local sNamePar6 = 'rf'
local sNamePar9 = 'ldr'
local sNamePar10 = 'tdr'
local sNamePar11 = 'ofr'
local sNamePar12 = 'hdr'
local sNamePar13 = 'bdr'
-- RunByComponentInterface
local RC = true
-- Messaggi codice errori
local EM = ' '
local EC = 0
local ErrorBase = 2700
-- variabili che abilitano la creazione della geometria
local bMakeFaceGeom3 = true
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
-- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
local nForceMakeFace = nDrawMach
if not Dhr or Dhr < GEO.EPS_SMALL or ( rty and rty == 1 and ( rl < GEO.EPS_SMALL or rw < GEO.EPS_SMALL)) then -- se rettangolo con spessore o dimensioni a 0
bMakeFaceGeom3 = false
end
-- if nForceMakeFace == 0 then -- se solo geometria disabilito il raggio fresa
-- esfr = 0
-- end
if ldr then ldr = abs(ldr) end
if hdr then hdr = abs(hdr) end
if tdr then tdr = abs(tdr) end
if bdr then bdr = abs(bdr) end
local EgtDoorsMsg = require( 'EgtDoorsMsg')
if not bPreview and EC ~= 0 then
return (ErrorBase+EC), EM
end
-- Se Preview cancello tutto
if bPreview then
EgtNewFile()
EgtSetDefaultMaterial( BLACK())
end
-- Pezzo e Layer
local Pz
if bPreview then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
else
if not RC then
Pz = EgtGetCurrPart() -- pezzo corrente
end
if not Pz then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
end
end
-- Layer
local Dm
local Lg
local GId
local hint
local nRev
local pIni, pEnd
local dStartValX, dStopValX
local dStartValY, dStopValY
local dValXv1Ini, dValXv1End, dValYv1Ini, dValYv1End -- prima linea verticale
local dValXv2Ini, dValXv2End, dValYv2Ini, dValYv2End -- seconda linea verticale
local dValXh1Ini, dValXh1End, dValYh1Ini, dValYh1End -- prima linea orizzontale
local dValXh2Ini, dValXh2End, dValYh2Ini, dValYh2End -- seconda linea orizzontale
local dStart
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName(Lg,sCompoName)
if nDrawMach > 0 then -- se abilitata geometria lavorazione
Dm = EgtGroup( Pz, GDB_RT.LOC) -- layer disegni cerchi rappresentante il diametro utensile
EgtSetName(Dm,DM)
end
if nForceMakeFace ~= 1 then -- se abilitata geometria esterna
if bMakeFaceGeom3 then -- se posso fare rettangolo
if not rty or rty == 0 then -- se rettangolo con offset
-- messaggio di errore
if 2*(abs(ofr)+esfr) >= W or 2*(abs(ofr)+esfr) >= L then -- se offset troppo grande
EC = 26
EM = string.format( EgtDoorsMsg[649], sNamePar11, EgtToUiUnits(ofr), EgtToUiUnits(esfr), EgtToUiUnits(min(((W/2)-esfr),((L/2)-esfr))-0.01), sCompoPath)
return (ErrorBase+EC), EM
end
-- al valore dell'offset viene aggiunta al raggio utensile
-- il rettangolo può risultare quindi inferiore
GId = EgtRectangle2P( Lg, Point3d( -(W/2)+(abs(ofr)+esfr), -(L/2)+(abs(ofr)+esfr), 0), Point3d( (W/2)-(abs(ofr)+esfr), (L/2)-(abs(ofr)+esfr), 0), GDB_RT.GLOB)
if GId then
-- cambio il punto di inizio in centro al lato inferiore
EgtChangeClosedCurveStartPoint( GId, Point3d( 0, -(L/2)+(abs(ofr)+esfr), 0), GDB_RT.GLOB)
EgtMove( GId, Point3d(W/2,L/2,0) - ORIG())
EgtModifyCurveThickness( GId, -Dhr) -- di default è sul lato keyway
EgtSetName( GId, LGR)
end
else -- rettangolo con geometria
if rty and rty == 2 then -- se rettangolo ricavato dalle distanze ricalcolo le dimensioni e il raccordo perché sono le distanze dai bordi a essere preservate
rw = W - ldr - hdr - (esfr*4)
rl = L - tdr - bdr - (esfr*4)
-- forzo la geometria a un valore che poi viene calcolato comunque dalle distanze dai bordi.
-- con valore 0 si ottiene la centratura del rettangolo risultante con la porta
-- con valori 1, 2, 4 e 5 si rispettano le distanze dai bordi
-- con valori 3 e 6 si ottiene la centratura in X del rettangolo risultante, le distanze top e bottom rispettano i relativi parametri.
-- con valori 7 e 8 si ottiene la centratura in Y del rettangolo risultante, le distanze lock e hinge rispettano i relativi parametri.
rer = 1
-- se le dimensioni risultano negative do errore
if rw+(esfr*2) <= 0 then
EC = 27
EM = string.format( EgtDoorsMsg[626], sNamePar9..'+'..sNamePar12, EgtToUiUnits(ldr+hdr), EgtToUiUnits(W-(esfr*2)-0.01), sCompoPath)
return (ErrorBase+EC), EM
elseif rl+(esfr*2) <= 0 then
EC = 28
EM = string.format( EgtDoorsMsg[626], sNamePar10..'+'..sNamePar13, EgtToUiUnits(tdr+bdr), EgtToUiUnits(L-(esfr*2)-0.01), sCompoPath)
return (ErrorBase+EC), EM
end
-- se ho il raccordo
if rf then
rf = rf - (esfr*2)
end
end
-- se le dimensioni del raccordo sono eccessive le riconduco a valori accettabili
if rl and rw and rf then
if 2*rf > min(rl,rw) then
rf = min(rl,rw)/2
end
end
if rf > 0 or not pre or pre == 0 then -- rettangolo con raccordo o non ho prelazione
local dCompareRadius = rf
if rty and rty == 2 then -- se rettangolo ricavato dalle distanze
dCompareRadius = dCompareRadius + esfr
end
if dCompareRadius > 0 then -- rettangolo con raccordo
-- alle dimensioni del rettangolo viene aggiunto il diametro utensile
-- il rettangolo può risultare quindi maggiorato
GId = DrawRectangleWithFillet ( Lg, rw+(2*esfr), rl+(2*esfr), 0, rf+esfr)
else -- senza raccordo
-- alle dimensioni del rettangolo viene aggiunto il diametro utensile
-- il rettangolo puo' risultare quindi maggiorato
GId = EgtRectangle2P( Lg, Point3d( -(rw/2)-esfr, -(rl/2)-esfr, 0), Point3d( (rw/2)+esfr, (rl/2)+esfr, 0), GDB_RT.GLOB)
end
if GId then
-- cambio il punto di inizio in centro al lato inferiore
EgtChangeClosedCurveStartPoint( GId, Point3d( 0, -(rl/2)-esfr, 0), GDB_RT.GLOB)
if not rer or rer == 0 then -- se in centro
EgtMove( GId, Point3d(W/2,L/2,0) - ORIG())
elseif rer == 1 then -- se riferito top-lock
if rty and rty == 2 then -- se rettangolo ricavato dalle distanze
EgtMove( GId, Point3d(((rw+(2*esfr))/2)+(ldr+esfr),L-((rl+(2*esfr))/2)-(tdr+esfr),0) - ORIG())
else
EgtMove( GId, Point3d(((rw+(2*esfr))/2)+(ldr-esfr),L-((rl+(2*esfr))/2)-(tdr-esfr),0) - ORIG())
end
elseif rer == 2 then -- se riferito top-hinge
EgtMove( GId, Point3d(W-((rw+(2*esfr))/2)-(hdr-esfr),L-((rl+(2*esfr))/2)-(tdr-esfr),0) - ORIG())
elseif rer == 3 then -- se riferito top-center
EgtMove( GId, Point3d(W/2,L-((rl+(2*esfr))/2)-(tdr-esfr),0) - ORIG())
elseif rer == 4 then -- se riferito bottom-lock
EgtMove( GId, Point3d(((rw+(2*esfr))/2)+(ldr-esfr),((rl+(2*esfr))/2)+(bdr-esfr),0) - ORIG())
elseif rer == 5 then -- se riferito bottom-hinge
EgtMove( GId, Point3d(W-((rw+(2*esfr))/2)-(hdr-esfr),((rl+(2*esfr))/2)+(bdr-esfr),0) - ORIG())
elseif rer == 6 then -- se riferito bottom-center
EgtMove( GId, Point3d(W/2,((rl+(2*esfr))/2)+(bdr-esfr),0) - ORIG())
elseif rer == 7 then -- se riferito center-lock
EgtMove( GId, Point3d(((rw+(2*esfr))/2)+(ldr-esfr),L/2,0) - ORIG())
elseif rer == 8 then -- se riferito center-hinge
EgtMove( GId, Point3d(W-((rw+(2*esfr))/2)-(hdr-esfr),L/2,0) - ORIG())
end
EgtModifyCurveThickness( GId, -Dhr) -- di default è sul lato keyway
EgtSetName( GId, LGR)
end
else -- ho prelazione
if pre == 1 then -- se prelazione su linee verticali
-- prima linea verticale
if not rer or rer == 0 or rer == 3 or rer == 6 then -- se in centro in X
dValXv1Ini = (W-rw)/2 - esfr
elseif rer == 1 or rer == 4 or rer == 7 then -- se riferito a lock
if rty and rty == 2 then -- se rettangolo ricavato dalle distanze
dValXv1Ini = ldr + esfr
else
dValXv1Ini = ldr - esfr
end
else -- tutti gli altri casi (riferito a hinge)
dValXv1Ini = W - hdr + esfr
end
dValXv1End = dValXv1Ini
dValYv1Ini = L - clr -- posizione in alto
dValYv1End = clr
-- disegno linea
pIni = Point3d( dValXv1Ini, dValYv1Ini, 0)
pEnd = Point3d( dValXv1End, dValYv1End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
-- seconda linea verticale
if rer and ( rer == 2 or rer == 5 or rer == 8) then -- se riferito a hinge
dValXv2Ini = dValXv1Ini - rw - 2*esfr
else -- tutti gli altri casi (riferito a lock)
dValXv2Ini = dValXv1Ini + rw + 2*esfr
end
dValXv2End = dValXv2Ini
dValYv2Ini = L - clr -- posizione in alto
dValYv2End = clr
-- disegno linea
pIni = Point3d( dValXv2Ini, dValYv2Ini, 0)
pEnd = Point3d( dValXv2End, dValYv2End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
-- prima linea orizzontale
if not rer or rer == 0 or rer == 7 or rer == 8 then -- se in centro
dValYh1Ini = (L+rl)/2 + esfr
elseif rer >= 1 and rer <= 3 then -- se riferito top
if rty and rty == 2 then -- se rettangolo ricavato dalle distanze
dValYh1Ini = L - tdr - esfr
else
dValYh1Ini = L - tdr + esfr
end
else -- tutti gli altri casi (bottom)
dValYh1Ini = bdr - esfr
end
dValYh1End = dValYh1Ini
if rer and ( rer == 2 or rer == 5 or rer == 8) then -- se riferito a hinge
dValXh1Ini = dValXv1Ini - cir
dValXh1End = dValXv2Ini + cir
else -- negli altri casi (riferito a lock)
dValXh1Ini = dValXv1Ini + cir
dValXh1End = dValXv2Ini - cir
end
-- disegno linea
pIni = Point3d( dValXh1Ini, dValYh1Ini, 0)
pEnd = Point3d( dValXh1End, dValYh1End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
-- seconda linea orizzontale
if rer and ( rer >= 4 and rer <= 6) then -- se riferito a bottom
dValYh2Ini = dValYh1Ini + rl + 2*esfr
else -- in tutti gli altri casi (top)
dValYh2Ini = dValYh1Ini - rl - 2*esfr
end
dValYh2End = dValYh2Ini
if rer and ( rer == 2 or rer == 5 or rer == 8) then
dValXh2Ini = dValXv1Ini - cir
dValXh2End = dValXv2Ini + cir
else -- negli altri casi
dValXh2Ini = dValXv1Ini + cir
dValXh2End = dValXv2Ini - cir
end
-- disegno linea
pIni = Point3d( dValXh2Ini, dValYh2Ini, 0)
pEnd = Point3d( dValXh2End, dValYh2End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
else -- ho prelazione su linee orizzontali
-- prima linea orizzontale
if not rer or rer == 0 or rer == 7 or rer == 8 then -- se in centro
dValYh1Ini = (L+rl)/2 + esfr
elseif rer >= 1 and rer <= 3 then -- se riferito top
if rty and rty == 2 then -- se rettangolo ricavato dalle distanze
dValYh1Ini = L - tdr - esfr
else
dValYh1Ini = L - tdr + esfr
end
else -- tutti gli altri casi (bottom)
dValYh1Ini = bdr - esfr
end
dValYh1End = dValYh1Ini
dValXh1Ini = clr -- posizione a sinistra
dValXh1End = W - clr
-- disegno linea
pIni = Point3d( dValXh1Ini, dValYh1Ini, 0)
pEnd = Point3d( dValXh1End, dValYh1End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
-- seconda linea orizzontale
if rer and ( rer >= 4 and rer <= 6) then -- se riferito a bottom
dValYh2Ini = dValYh1Ini + rl + 2*esfr
else -- in tutti gli altri casi
dValYh2Ini = dValYh1Ini - rl - 2*esfr
end
dValYh2End = dValYh2Ini
dValXh2Ini = clr -- posizione a sinistra
dValXh2End = W - clr
-- disegno linea
pIni = Point3d( dValXh2Ini, dValYh2Ini, 0)
pEnd = Point3d( dValXh2End, dValYh2End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
-- prima linea verticale
if not rer or rer == 0 or rer == 3 or rer == 6 then -- se in centro
dValXv1Ini = (W-rw)/2 - esfr
elseif rer == 1 or rer == 4 or rer == 7 then -- se riferito a lock
if rty and rty == 2 then -- se rettangolo ricavato dalle distanze
dValXv1Ini = ldr + esfr
else
dValXv1Ini = ldr - esfr
end
else -- tutti gli altri casi (riferito a hinge)
dValXv1Ini = W - hdr + esfr
end
dValXv1End = dValXv1Ini
if rer and ( rer >= 4 and rer <= 6) then -- se riferito a bottom
dValYv1Ini = dValYh1Ini + cir
dValYv1End = dValYh2Ini - cir
else -- tutti gli altri casi (top)
dValYv1Ini = dValYh1Ini - cir
dValYv1End = dValYh2Ini + cir
end
-- disegno linea
pIni = Point3d( dValXv1Ini, dValYv1Ini, 0)
pEnd = Point3d( dValXv1End, dValYv1End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
-- seconda linea verticale
if rer and ( rer == 2 or rer == 5 or rer == 8) then -- se in centro
dValXv2Ini = dValXv1Ini - rw - 2*esfr
else -- tutti gli altri casi
dValXv2Ini = dValXv1Ini + rw + 2*esfr
end
dValXv2End = dValXv2Ini
if rer and ( rer >= 4 and rer <= 6) then -- se riferito a bottom
dValYv2Ini = dValYh1Ini + cir
dValYv2End = dValYh2Ini - cir
else -- tutti gli altri casi (top)
dValYv2Ini = dValYh1Ini - cir
dValYv2End = dValYh2Ini + cir
end
-- disegno linea
pIni = Point3d( dValXv2Ini, dValYv2Ini, 0)
pEnd = Point3d( dValXv2End, dValYv2End, 0)
hint = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, (d3/2), true, true, RED(), RED())
if hint then
EgtModifyCurveThickness( hint, -Dhr) -- di default è sul lato keyway
EgtSetName( hint, LGR)
end
end
end
-- messaggi di errore (dopo aver fatto il disegno)
if rty and rty == 1 then -- se rettangolo con dimensioni definite
if not rer or rer == 0 then -- se in centro
if rw + (2*esfr) >= W then -- se larghezza rettangolo è più grande della larghezza porta
EC = 29
EM = string.format( EgtDoorsMsg[626], sNamePar2, EgtToUiUnits(rw), EgtToUiUnits(W-(2*esfr)-0.001), sCompoPath)
return (ErrorBase+EC), EM
elseif rl + (2*esfr) >= L then -- se altezza rettangolo è più grande dell'altezza porta
EC = 30
EM = string.format( EgtDoorsMsg[626], sNamePar1, EgtToUiUnits(rl), EgtToUiUnits(L-(2*esfr)-0.001), sCompoPath)
return (ErrorBase+EC), EM
end
else
if rw + (2*esfr) >= W then -- se larghezza rettangolo è più grande della larghezza porta
EC = 31
EM = string.format( EgtDoorsMsg[626], sNamePar2, EgtToUiUnits(rw), EgtToUiUnits(W-(2*esfr)-0.001), sCompoPath)
return (ErrorBase+EC), EM
elseif rl + (2*esfr) >= L then -- se altezza rettangolo è più grande dell'altezza porta
EC = 32
EM = string.format( EgtDoorsMsg[626], sNamePar1, EgtToUiUnits(rl), EgtToUiUnits(L-(2*esfr)-0.001), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and ( rer == 2 or rer == 5 or rer == 8) and ( hdr+esfr+rw >= W) then -- se riferito a hinge e sborda in X
EC = 33
EM = string.format( EgtDoorsMsg[650], sNamePar12, EgtToUiUnits(hdr), sNamePar2, EgtToUiUnits(rw), EgtToUiUnits(esfr), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and ( rer == 2 or rer == 5 or rer == 8) and ( hdr-esfr <= 0) then -- se riferito a hinge e sborda in X
EC = 34
EM = string.format( EgtDoorsMsg[665], sNamePar12, EgtToUiUnits(hdr), EgtToUiUnits(esfr), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and (rer == 1 or rer == 4 or rer == 7) and (ldr+esfr+rw >= W) then -- se riferito a lock e sborda in X
EC = 35
EM = string.format( EgtDoorsMsg[650], sNamePar9, EgtToUiUnits(ldr), sNamePar2, EgtToUiUnits(rw), EgtToUiUnits(esfr), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and (rer == 1 or rer == 4 or rer == 7) and (ldr-esfr <= 0) then -- se riferito a lock e sborda in X
EC = 36
EM = string.format( EgtDoorsMsg[665], sNamePar9, EgtToUiUnits(ldr), EgtToUiUnits(esfr), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and ( rer >= 4 and rer <= 6) and (bdr+esfr+rl >= L) then -- se riferito a bottom e sborda in Y
EC = 37
EM = string.format( EgtDoorsMsg[651], sNamePar13, EgtToUiUnits(bdr), sNamePar1, EgtToUiUnits(rl), EgtToUiUnits(esfr*2), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and ( rer >= 4 and rer <= 6) and (bdr-esfr <= 0) then -- se riferito a bottom e sborda in Y
EC = 38
EM = string.format( EgtDoorsMsg[666], sNamePar13, EgtToUiUnits(bdr), EgtToUiUnits(esfr), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and ( rer >= 1 and rer <= 3) and (tdr+esfr+rl >= L) then -- se riferito a top e rettangolo sborda in Y
EC = 39
EM = string.format( EgtDoorsMsg[651], sNamePar10, EgtToUiUnits(tdr), sNamePar1, EgtToUiUnits(rl), EgtToUiUnits(esfr*2), sCompoPath)
return (ErrorBase+EC), EM
elseif rer and ( rer >= 1 and rer <= 3) and (tdr-esfr <= 0) then -- se riferito a top e rettangolo sborda in Y
EC = 40
EM = string.format( EgtDoorsMsg[666], sNamePar10, EgtToUiUnits(tdr), EgtToUiUnits(esfr), sCompoPath)
return (ErrorBase+EC), EM
end
end
end
end
end
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
EgtSetColor( Lg or GDB_ID.NULL, AQUA())
else
EgtSetColor( Lg or GDB_ID.NULL, ORANGE())
end
end
-- Se non Preview
-- (NOTA : se ci sono errori il componente non viene eseguito dal programma di gestione dei componenti)
if not bPreview then
if bRunByCompo then
-- scrivo i parametri nelle info del pezzo
WriteCompoDataToPart(Pz,sCompoName,nCompoNpar)
end
-- scrivo note nel layer della cerniera
EgtSetInfo(Lg,'Type' ,'fc_rectangle')
EgtSetInfo(Lg,'L' ,L)
EgtSetInfo(Lg,'W' ,W)
EgtSetInfo(Lg,'Dhr' ,Dhr)
EgtSetInfo(Lg,'rty' ,rty)
EgtSetInfo(Lg,'ofr' ,ofr)
EgtSetInfo(Lg,'rer' ,rer)
EgtSetInfo(Lg,'tdr' ,tdr)
EgtSetInfo(Lg,'bdr' ,bdr)
EgtSetInfo(Lg,'ldr' ,ldr)
EgtSetInfo(Lg,'hdr' ,hdr)
EgtSetInfo(Lg,'rw' ,rw)
EgtSetInfo(Lg,'rl' ,rl)
EgtSetInfo(Lg,'rf' ,rf)
EgtSetInfo(Lg,'clr' ,clr)
EgtSetInfo(Lg,'cir' ,cir)
EgtSetInfo(Lg,'esfr' ,esfr)
EgtSetInfo(Lg,'pre' ,pre)
EgtSetInfo(Lg,'dtype' ,dtype)
EgtSetInfo(Lg,'LGR' ,LGR)
EgtSetInfo(Lg,'Path' ,sCompoPath)
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase(Dm)
end
end
if EC == 0 and nCodAdj and nCodAdj < 0 then
EC = nCodAdj
EM = sCodAdj
end
return EC, EM, Lg
end
return fc_rectangle
+129
View File
@@ -0,0 +1,129 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- FaceDecoration.lua by EgalWare s.r.l. 2019.05.07
-- Autore: Filippo Monchi
-- FaceDecoration dati i valori 'Thickness' e 'face' e con nome attributo
-- 2019.05.07 V1.000 FM Write Component
-- 2019.09.24 V1.001 FM Manage side distance parameters (top, bottom, lock, hinge) from ddf
-- 2019.09.25 V1.002 FM Fix some error on calculate lines and rectangle position when diameter tool used
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.10.18 V2.000 FM Manage to draw not premptive lines between premptive lines only if premptive lines are 2 and their start and stop
-- distances are defined and without or zero step value
-- 2022.07.27 V2.001 FM Modification to use compiled code
-- 2023.05.15 V2.002 FM fix errors (x/0) when exists only 1 horizontal line and/or only 1 vertical line and both distances ( from reference and opposite sides) are difined
-- 2024.03.04 V2.100 FM Manage Custom lua decoration, managed by external file (defined into .templ file as .luc extension)
-- Tavola per definizione modulo (serve ma non usata)
local FaceDecoration = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Funzione di sistemazione parametri
function FaceDecoration.AdjustParams( tMhPar)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local dNumMessage
local dNumLog = 0
local sMessToOut = ''
-- setto le variabili dimensioni porta
tMhPar.W = DGD.dW
tMhPar.L = DGD.dH
if string.lower(DGD.TYPE) == 'lines' then
tMhPar.type = 1 -- 1: lines, 2: rectangle, 3: custom
tMhPar.CGF = 'Fc_Lines.lua'
-- percorso custom
if tMhPar.CGF and tMhPar.CGP then
if string.len(tMhPar.CGF) > 0 and string.len(tMhPar.CGP) == 0 then
tMhPar.CGP = tMhPar.ITP
end
elseif not tMhPar.CGP then
tMhPar.CGP = DGD.BASEDIR .. 'LuaLibs\\'
end
elseif string.lower(DGD.TYPE) == 'rectangle' then
tMhPar.type = 2 -- 1: lines, 2: rectangle, 3: custom
tMhPar.CGF = 'FC_Rectangle.lua'
-- percorso custom
if tMhPar.CGF and tMhPar.CGP then
if string.len(tMhPar.CGF) > 0 and string.len(tMhPar.CGP) == 0 then
tMhPar.CGP = tMhPar.ITP
end
elseif not tMhPar.CGP then
tMhPar.CGP = DGD.BASEDIR .. 'LuaLibs\\'
end
else
tMhPar.type = 3 -- 1: lines, 2: rectangle, 3: custom
if not tMhPar.CGP then
tMhPar.CGP = tMhPar.ITP
end
-- percorso custom
if tMhPar.CGF and tMhPar.CGP then
if string.len(tMhPar.CGF) > 0 and string.len(tMhPar.CGP) == 0 then
tMhPar.CGP = tMhPar.ITP
end
end
end
-- verifico esiste il file
local sFilePath,sFileName,sFileExt = EgtSplitPath( string.lower(tMhPar.CGP..tMhPar.CGF))
if not EgtExistsFile( string.lower(tMhPar.CGP..tMhPar.CGF)) then-- provo con lua
dNumLog = 2745
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[411], tMhPar.CGP..tMhPar.CGF, DGD.FILE)
end
if dNumLog ~= 0 then
return tMhPar, dNumLog, sMessToOut
end
return tMhPar, 0, ''
end
-- Funzione di disegno
function FaceDecoration.Draw( tFDecorPar, bPreview, bRunByCompo, nDrawMach)
-- verifico esiste il file
local sFilePath, sFileName, sFileExt = EgtSplitPath( string.lower(tFDecorPar.CGP..tFDecorPar.CGF))
-- se file custom aggiungo la path
if tFDecorPar.type == 3 then
EgtAddToPackagePath( tFDecorPar.CGP .. '?.luc')
end
-- Lancio il componente base
local VLOgen = require( sFileName)
tFaceDecorPar, nCod, sCod = VLOgen.AdjustParams( tFaceDecorPar)
if nCod > 0 then
return nCod, sCod
else
tFaceDecorPar.nCod = nCod
tFaceDecorPar.sCod = sCod
end
return VLOgen.Draw( tFaceDecorPar, false, false, DGD.MachEn)
end
return FaceDecoration
+1009
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1904
View File
File diff suppressed because it is too large Load Diff
+201
View File
@@ -0,0 +1,201 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- ImportNgeFile.lua by EgalWare s.r.l. 2016.06.14
-- Autore: Filippo Monchi
-- importazione file .nge
-- 2017.06.16 V1.011 FM Check bore thickness when its color is not green or red
-- 2019.04.19 V1.012 FM Fix import hinges as nge file; fix on import DeltaPos note from geometry and let it to a new layer
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2021.04.23 V2.001 FM Manage info about hatching
-- 2021.11.24 V2.002 FM Manage side probe option if variable DGC.Pms > 2
-- 2022.07.27 V2.003 FM Modification to use compiled code
-- 2023.05.08 V2.004 FM Manage scale factor if length and width are <= than 10 (max scale factor)
-- Tavola per definizione modulo (serve ma non usata)
local ImportNgeFile = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Funzione di disegno
function ImportNgeFile.Draw( CustGeomPath, CustGeomFile )
-- Messaggi codice errori
local EM = ' '
local EC = 0
local ErrorBase = 1050
local EgtDoorsMsg = require( 'EgtDoorsMsg')
-- Pezzo e Layer
local Pz = EgtGetCurrPart() -- pezzo corrente
local Lg
-- Gestione file custom
local MakeFaceGeom = true
local sCompoName
-- nota presenza hatching
local bHatch
-- caricamento del file custom
if CustGeomFile and string.find( string.lower(CustGeomFile), '.nge') then
-- sostituisco il carattere '\' con '_' nel nome file
CustGeomFile = string.gsub(CustGeomFile, '\\', '_')
CustGeomFile = string.gsub(CustGeomFile, '/', '_')
_,sCompoName,_ = EgtSplitPath( CustGeomFile)
-- concateno il file alla path
local sCustomPathFile = CustGeomPath..CustGeomFile
local nNewPart
local nNewLayer
local nNewEnt
local nTypeEnt
local sTypeInfo
local cColor
local sDeltaPos
-- provo ad inserire
MakeFaceGeom = not EgtInsertFile( sCustomPathFile)
-- se fallito inserimento file do un messaggio di errore
if MakeFaceGeom then
EC = 1
EM = string.format( EgtDoorsMsg[412], sCustomPathFile)
return (ErrorBase+EC), EM
end
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer principale
EgtSetName(Lg,sCompoName)
nNewPart = EgtGetNext(Pz) -- nome nuovo pezzo
nNewLayer = EgtGetFirstInGroup( nNewPart) -- ottengo nuovo layer
-- applico la scala
if nNewLayer then
-- se è in mm
local dCompare = 1
if DGD.bMM then
dCompare = 1
else
dCompare = 25.4
end
-- se ha la nota che permette di scalare
local bScale = EgtGetInfo( nNewPart, 'AllowScale', 'b') or false
-- se inferiore ai 10"
if bScale and abs(DGD.LENGTH)/dCompare <= 10 and abs(DGD.WIDTH)/dCompare <= 10 then
local dLength = EgtIf( DGD.bMM, abs(DGD.LENGTH), abs(DGD.LENGTH)/dCompare)
local dWidth = EgtIf( DGD.bMM, abs(DGD.WIDTH), abs(DGD.WIDTH)/dCompare)
EgtScale(nNewPart,{{0,0,0},{1,0,0},{0,1,0},{0,0,1}}, dWidth, dLength, 1, GDB_RT.GLOB)
end
end
-- riloco tutti i nuovi layer dal nuovo pezzo al pezzo corrente
while nNewLayer do
-- verifico se esiste la nota hatch
bHatch = EgtGetInfo( nNewLayer, 'hatch', 'b')
nNewEnt = EgtGetFirstInGroup( nNewLayer) -- ottengo nuova entità
while nNewEnt do
-- controllo se ha dei colori e le note giuste per cambiare lo spessore
nTypeEnt = EgtGetType( nNewEnt)
sTypeInfo = EgtGetInfo( nNewEnt, 'SideDoor')
if not sDeltaPos then
sDeltaPos = EgtGetInfo( nNewEnt, 'DeltaPos')
end
cColor = EgtGetCalcColor( nNewEnt)
local sNoteKeepBs = EgtGetInfo( nNewEnt, 'KeepBackSet')
local sNoteProbes = EgtGetInfo( nNewEnt, 'ProbeSide')
if sTypeInfo and cColor and DGD.dT then
if string.lower(sTypeInfo) == 'keyway' or string.lower(sTypeInfo) == 'secure' then
if AreSameColor(cColor,RED(),30) then -- se colore rosso allora spessore completo
EgtModifyCurveThickness( nNewEnt, -DGD.dT)
elseif AreSameColor(cColor,LIME(),30) then -- se colore verde allora metà spessore
EgtModifyCurveThickness( nNewEnt, -(DGD.dT/2))
if sNoteKeepBs then -- se ho assegnato la nota la ritrascrivo modificata
EgtSetInfo( nNewEnt, 'KeepBackSet', 'x') -- setto 'x' provvisoriamente
end
if sNoteProbes then
EgtSetInfo( nNewEnt, 'ProbeSide', '1')
end
else -- altrimenti controllo che lo spessore non supera quello della porta, se lo supera lo setto = spessore porta
local dTh = EgtCurveThickness( nNewEnt)
if abs(dTh) > DGD.dT then
EgtModifyCurveThickness( nNewEnt, EgtIf( dTh > 0, DGD.dT, -DGD.dT))
elseif abs(dTh) < DGD.dT then
if sNoteKeepBs then -- se ho assegnato la nota la ritrascrivo modificata
EgtSetInfo( nNewEnt, 'KeepBackSet', 'x') -- setto 'x' provvisoriamente
end
if sNoteProbes then
EgtSetInfo( nNewEnt, 'ProbeSide', '1')
end
end
end
end
elseif sTypeInfo and ( string.lower(sTypeInfo) == 'keyway' or string.lower(sTypeInfo) == 'secure') then
-- controllo che lo spessore non supera quello della porta, se lo supera lo setto = spessore porta
local dTh = EgtCurveThickness( nNewEnt)
if abs(dTh) > DGD.dT then
EgtModifyCurveThickness( nNewEnt, EgtIf( dTh > 0, DGD.dT, -DGD.dT))
elseif abs(dTh) < DGD.dT then
if sNoteKeepBs then -- se ho assegnato la nota la ritrascrivo modificata
EgtSetInfo( nNewEnt, 'KeepBackSet', 'x') -- setto 'x' provvisoriamente
end
if sNoteProbes then
EgtSetInfo( nNewEnt, 'ProbeSide', '1')
end
end
end
EgtRelocateGlob( nNewEnt, Lg) -- riloco nel layer corrente
nNewEnt = EgtGetFirstInGroup(nNewLayer)
end
nNewLayer = EgtGetNext(nNewLayer)
end
-- cancello il nuovo pezzo
EgtErase(nNewPart)
-- assegno la nota sulla posizione locale
if sDeltaPos then
EgtSetInfo( Lg, 'DeltaPos', sDeltaPos)
end
else
EC = ErrorBase + 2
EM = string.format( EgtDoorsMsg[411], CustGeomFile, DGD.FILE)
end
-- se non ho caricato il file geom esco
if not MakeFaceGeom then
-- (NOTA : se ci sono errori il componente non viene eseguito dal programma di gestione dei componenti)
-- scrivo note nel layer
EgtSetInfo( Lg, 'Type' , 'ImportNgeFile')
EgtSetInfo( Lg, 'CustGeomFile' ,CustGeomFile)
EgtSetInfo( Lg, 'CustGeomPath' ,CustGeomPath)
EgtSetInfo( Lg, 'hatch' ,bHatch)
end
return EC, EM, Lg
end
return ImportNgeFile
File diff suppressed because it is too large Load Diff
+744
View File
@@ -0,0 +1,744 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- LouverCutOut.lua by EgalWare s.r.l. 2016.06.30
-- Autore: Filippo Monchi
-- LouverCutOut dati i valori 'L' e 'H' e con nome attributo
-- 2017.10.18 V1.0a1 FM Start point path near lock side
-- 2017.12.07 V1.0a3 FM Add Cleancorner path
-- 2018.01.11 V1.0a4 FM Add Hatching
-- 2018.08.24 V1.0a5 FM Add internal radius on clean-corner paths
-- 2018.10.09 V1.0a6 FM check better the error condition with radius on clean corner path
-- 2019.10.02 V1.019 FM Manage steel option (disable generation of some geometries)
-- 2019.10.07 V1.01a FM Manage cut by saw
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.12.06 V2.001 FM Fix error on not initialized variable d into hatching section
-- 2020.04.29 V2.002 FM Update for aluminum material
-- 2021.01.22 V3.000 FM Manage better checking error on tools and dimension when produce flag is false
-- 2021.04.23 V3.001 FM Manage note to indicate if hatching is present
-- 2021.04.27 V3.002 FM Manage special region on hatching paths to remove pods under those
-- 2022.07.27 V3.003 FM Modification to use compiled code
-- 2023.05.12 V3.004 FM Manage clean corner with cone tool
-- 2023.05.12 V3.005 FM Fix error on disabled clean cone parameter ccn
-- 2024.09.12 V3.006 FM Fix error on print error/warning message with wrongg variables
-- 2024.10.19 V3.007 FM Manage drop path with back and forth
-- 2024.11.14 V3.011 FM Manage new ConeCleanCorner path by CurrDoorCustomData DGC.Ccm parameter
-- Tavola per definizione modulo (serve ma non usata)
local LouverCutOut = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Valori limite
local DimMin = 2. -- valore minimo lato
local function GetMachToolErrorMessage( nErrorId, sGeomName, dIdMach, dOriDiamTool, nIdLogErr, sMchngName)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local sMessage = ''
if dOriDiamTool then
if nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[466], nIdLogErr, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -2 then -- errore nel settare la lavorazione, lavorazione non presente in libreria
sMessage = string.format(EgtDoorsMsg[467], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[468], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[469], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[470], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[471], nIdLogErr, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[472], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
elseif nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[504], nIdLogErr, dIdMach, sGeomName)
elseif nErrorId == -2 then -- errore nel settare la lavorazione
sMessage = string.format(EgtDoorsMsg[505], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[506], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[507], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[508], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[503], nIdLogErr, sGeomName)
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[473], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
return sMessage
end
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc, nRad, bDrawFirst, bDrawLast, cColor1, cColor2)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
if idTable then
table.insert( idTable, nLine)
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor(nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor(nCircle2, cColor2)
end
end
return nLine
end
-----------------------------------------------------------------
local function DrawRectangleAndMakeItsRegion( Lg, bPreview, Dm, nIdPath, dTh)
local nId, nId1, nId2, nId3, nId4
-- faccio gli offset in più e in meno e li unisco con le linee per creare il percorso
nId1 = EgtCopyGlob( nIdPath, Lg)
EgtOffsetCurve( nId1, 0.5)
nId3 = EgtCopyGlob( nIdPath, Lg)
EgtOffsetCurve( nId3, -0.5)
-- inverto il percorso 2
EgtInvertCurve( nId3)
-- prendo i punti da collegare
local pIni = EgtEP( nId1)
local pEnd = EgtSP( nId3)
nId2 = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
pIni = EgtEP( nId3)
pEnd = EgtSP( nId1)
nId4 = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
-- creo percorso
nId = EgtCurveCompo( Lg, {nId1,nId2,nId3,nId4}, true)
EgtModifyCurveThickness( nId, dTh)
-- creo estrusi e superfici piane delle geometrie passanti
AddSurfTmByExtrusion( Lg, nId, true, 2)
-- cancello il percorso utilizzato
if nId then
EgtErase( nId)
end
end
-- Funzione di sistemazione parametri
function LouverCutOut.AdjustParams( tMhPar)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local dMaxMat0
local dMaxMat1
local dMaxMat2
local dNumMessage
local dNumLog = 0
local sMessToOut = ''
local nTempT0
local nTempT1
local nTempT2
local sMchngName0
local sMchngName1
local sMchngName2
local nThBl0
local nThBl1
-- Assegno parametri da ddf
if DGD.LENGTH then
tMhPar.L = DGD.LENGTH
end
if DGD.WIDTH then
tMhPar.W = DGD.WIDTH
end
tMhPar.T = DGD.dT
-- verifico se presente il parametro DGC.Cmx ( massimo spessore per applicare la seconda modalità di ConeCleanCorner) e se ha i valori congruenti
if not DGC.Cmx then
tMhPar.Cmx = 0
else
tMhPar.Cmx = abs(DGC.Cmx)
end
-- verifico se presente il parametro DGC.Ccm ( ConeCleanCorner mode) e se ha i valori congruenti (0 o 1)
if not DGC.Ccm then
tMhPar.Ccm = 0
else
tMhPar.Ccm = abs( DGC.Ccm)
if tMhPar.Ccm > 1 then
tMhPar.Ccm = 0
end
-- verifico se spessore porta ammette la seconda modalità, nel caso torno alla prima modalità
if tMhPar.T > tMhPar.Cmx then
tMhPar.Ccm = 0
end
end
-- disattivo la lama se la cava è più profonda di una certa quota
if tMhPar.MaxBd and tMhPar.T and tMhPar.T > tMhPar.MaxBd then
tMhPar.bl = false
dNumLog = -1294
dNumMessage = 674
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(tMhPar.MaxBd))
end
local MB = require( 'MachiningBase')
local sLBM
local nLBMi = 1
local sDM
local nDMi = 1
local dMaxCutBladeLen = 0
local sCLCN
local nCLCNi = 1
local sNotesMach = ''
-- se porta steel o aluminum disabilito alcune geometrie non compatibili con il metallo
if FindMaterial( DGD.Material, 'steel') or FindMaterial( DGD.Material, 'aluminum') then
tMhPar.est = true
tMhPar.DM = nil
else
tMhPar.est = nil
end
if tMhPar.DM then
sDM = tMhPar.DM
end
if tMhPar.LBM then -- geometria con lama
sLBM = tMhPar.LBM
end
if tMhPar.CLCN then -- pulitira spigolo con utensile conico
sCLCN = tMhPar.CLCN
end
-- se devo disegnare le geometrie di lavorazione
if DGD.MachEn > 0 then
-- parametri utensile per hatching
if sDM and tMhPar.d then
nTempT1, dMaxMat1, sMchngName1, nThBl1 = MB.GetToolDataFromAttrib( sDM, nDMi)
end
-- se ha fallito con la prima colonna riprovo con la seconda
-- (la lavorazione potrebbe essere messa sulla seconda colonna della MTAble)
if sDM and tMhPar.d and not( nTempT1 and sMchngName1) then
nDMi = 2
nTempT1, dMaxMat1, sMchngName1, nThBl1 = MB.GetToolDataFromAttrib( sDM, nDMi)
end
if sLBM and tMhPar.bl and tMhPar.d3 then
nTempT0, dMaxMat0, sMchngName0, nThBl0 = MB.GetToolDataFromAttrib( sLBM, nLBMi)
end
if sCLCN then
nTempT2, dMaxMat2, sMchngName2, _, sNotesMach = MB.GetToolDataFromAttrib( sCLCN, nCLCNi, true)
end
if DGD.bProoduce and not est and nTempT2 and nTempT2 < 0 then
dNumLog = -1293
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT2, sCLCN, nCLCNi, 0, dNumLog, sMchngName2)
else
-- cerco la nota
local nPosFound = string.find( sNotesMach, 'RadToClean')
if nPosFound then
local sParz = string.sub( sNotesMach, nPosFound)
nPosFound = string.find( sParz, ';')
local sTrimmed
if nPosFound then
sTrimmed = string.sub( sParz, 1, nPosFound-1)
else
sTrimmed = sParz
end
if sTrimmed and #sTrimmed > 0 then
local sValue = string.sub( sTrimmed, 12)
if sValue and #sTrimmed > 0 then
local dVal = tonumber( sValue)
if dVal and abs(dVal) > GEO.EPS_SMALL then
tMhPar.dCleanNote = dVal
else
tMhPar.dCleanNote = 0
end
else
tMhPar.dCleanNote = 0
end
else
tMhPar.dCleanNote = 0
end
else
tMhPar.dCleanNote = 0
end
end
if DGD.bProoduce and not est and tMhPar.d and nTempT1 and nTempT1 <= 0 then
dNumLog = -1298
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT1, sDM, nDMi, tMhPar.d, dNumLog, sMchngName1)
elseif not est and nTempT1 then
tMhPar.d = nTempT1
end
if tMhPar.d3 and nTempT0 and nTempT0 <= 0 then -- lama
if DGD.bProoduce and tMhPar.bl then -- se utilizzo la lama
dNumLog = -1299
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT0, sLBM, nLBMi, tMhPar.d3, dNumLog, sMchngName0)
end
elseif nTempT0 then
tMhPar.d3 = nTempT0
if nThBl0 and nThBl0 > 0 then tMhPar.thb = nThBl0 end
end
-- se lo spessore porta è maggiore della capacità lama disabilito la lama ed emetto un warning
if tMhPar.bl and tMhPar.T and dMaxMat0 and tMhPar.T >= dMaxMat0 then
tMhPar.bl = false
tMhPar.LBM = nil
dNumLog = -1297
dNumMessage = 672
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sMchngName0, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat0))
end
-- se lo spessore porta è maggiore della capacità utensile hatching disabilito la lavorazione ed emetto un warning
if tMhPar.T and dMaxMat1 and tMhPar.T >= dMaxMat1 then
tMhPar.DM = nil
dNumLog = -1296
dNumMessage = 672
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sMchngName1, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat1))
end
-- se il blade è attivo calcolo se passa la lama nella sfinestratura
if tMhPar.bl and tMhPar.d3 and tMhPar.L and tMhPar.W then
-- calcolo la massima impronta lama
local dBladeRadius = tMhPar.d3 / 2
dMaxCutBladeLen = sqrt( (dBladeRadius * dBladeRadius) - ( ( dBladeRadius - tMhPar.T) * ( dBladeRadius - tMhPar.T)))
-- se l'impronta lama è maggiore della lunghezza o larghezza escludo la lama e do messaggio di warning
if (2*dMaxCutBladeLen) >= tMhPar.L or (2*dMaxCutBladeLen) >= tMhPar.W then
tMhPar.bl = false
tMhPar.LBM = nil
dNumLog = -1295
dNumMessage = 673
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sMchngName0)
end
end
-- se il blade è attivo e utensile lama e c'è il clean corner, lo ricalcolo in funzione del raggio lama
if tMhPar.bl and tMhPar.thb and tMhPar.thb > 0 and tMhPar.clc and tMhPar.clc > 0 then
if dMaxCutBladeLen > tMhPar.clc then
tMhPar.clc = dMaxCutBladeLen
end
end
if tMhPar.CL and tMhPar.clc and tMhPar.clc > 0 and ( tMhPar.clc >= tMhPar.W or tMhPar.clc >= tMhPar.L) then
tMhPar.clc = nil
elseif not tMhPar.CL then
tMhPar.clc = nil
end
end
if dNumLog ~= 0 then
return tMhPar, dNumLog, sMessToOut
end
return tMhPar, 0, ''
end
-- Funzione di disegno
function LouverCutOut.Draw( tLvrPar, bPreview, bRunByCompo, nDrawMach)
-- Assegno le dimensioni
local L = tLvrPar.L
local W = tLvrPar.W
local T = tLvrPar.T
local clc = tLvrPar.clc
local ccr = tLvrPar.ccr
local ccn = tLvrPar.ccn
local hml = tLvrPar.hml
local dml = tLvrPar.dml
local dmw = tLvrPar.dmw
local bl = tLvrPar.bl
local dbl = tLvrPar.dbl
local d = tLvrPar.d -- hatching tool diameter
local d3 = tLvrPar.d3 -- blade diameter
local dRadToClean = tLvrPar.dCleanNote or 0
local dConeCleanMode = tLvrPar.Ccm
local est = tLvrPar.est
-- Assegno i nomi
local LG = tLvrPar.LG
local LM = tLvrPar.LM
local CL = tLvrPar.CL
local CLCN = tLvrPar.CLCN
local DM = tLvrPar.DM -- nome lavorazione hatchind
local LBM = tLvrPar.LBM -- nome lavorazione con lama
-- variabili per messaggi e settaggi vari
local sCompoName = tLvrPar.Nome
local nCompoNpar = tLvrPar.Npar
local sCompoPath = tLvrPar.Path
-- eventuale messaggio errore rilevato nell'adjust
local nCodAdj = tLvrPar.nCod
local sCodAdj = tLvrPar.sCod
-- variabili per messaggi e settaggi vari
local sNamePar1 = tLvrPar.N1 or 'L'
local sNamePar2 = tLvrPar.N2 or 'H'
local sNamePar3 = tLvrPar.N3 or 'T'
local sNamePar4 = tLvrPar.N5 or 'clc'
local sNamePar5 = tLvrPar.N5 or 'ccr'
-- RunByComponentInterface
local RC = true
-- Messaggi codice errori
local EM = ' '
local EC = 0
local ErrorBase = 1200
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
-- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
local EgtDoorsMsg = require( 'EgtDoorsMsg')
-- variabile per gestione presenza hatching
local bExistsHatching = false
-- Verifica delle dimensioni, le condizioni vengono verificate in base a quale geometria deve essere creata
if L and L < DimMin then
EC = 1
EM = string.format(EgtDoorsMsg[407],sNamePar1,EgtToUiUnits(L),'',EgtToUiUnits(DimMin), sCompoPath) -- il parametro 'L' deve essere > DimMin
D = DimMin
elseif W and W < DimMin then
EC = 2
EM = string.format(EgtDoorsMsg[407],sNamePar2,EgtToUiUnits(H),'',EgtToUiUnits(DimMin), sCompoPath) -- il parametro 'H' deve essere > DimMin
W = DimMin
--[[
elseif CL and clc and clc > 0 and ( 2*clc) >= W then
EC = 3
EM = string.format(EgtDoorsMsg[407],sNamePar4..'*2',EgtToUiUnits(clc),sNamePar2,EgtToUiUnits(W), sCompoPath) -- il parametro 'clc*2' deve essere > W
clc = W/2-0.2
elseif CL and clc and clc > 0 and ( 2*clc) >= L then
EC = 4
EM = string.format(EgtDoorsMsg[407],sNamePar4..'*2',EgtToUiUnits(clc),sNamePar1,EgtToUiUnits(L), sCompoPath) -- il parametro 'clc*2' deve essere > L
clc = L/2-0.2
]]--
elseif CL and clc and ccr and clc > 0 and ccr > 0 and (2*(ccr*sin(45))) >= clc then
EC = 5
EM = string.format(EgtDoorsMsg[407],sNamePar4,EgtToUiUnits(clc),'',EgtToUiUnits(2*(ccr*sin(45))), sCompoPath) -- il parametro 'clc' deve essere > 'crc'
clc = (2*(ccr*sin(45)))+0.2
end
if not bPreview and EC ~= 0 then
return (ErrorBase+EC), EM
end
-- Se Preview cancello tutto
if bPreview then
EgtNewFile()
EgtSetDefaultMaterial( BLACK())
end
-- Pezzo e Layer
local Pz
if bPreview then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
else
if not RC then
Pz = EgtGetCurrPart() -- pezzo corrente
end
if not Pz then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
end
end
local Lg
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName(Lg,sCompoName)
local pIni, pEnd
local GId, MId, CLC1, CLC2, CLC3, CLC4
local CLCN1, CLCN2, CLCN3, CLCN4
local nKindGeom
local bSingleMode = true
-- Costruzione della geometria
GId = EgtRectangle2P( Lg, Point3d( 0, 0, T), Point3d( W, L, T), GDB_RT.GLOB)
-- Costruzione della geometria clean corner
if nDrawMach >= 0 then -- se abilitata geometria
-- se ci sono i parametri per i percorsi clean corner
if CL and clc and clc > 0 and clc < W and clc < L then
-- angolo x-y+
CLC1 = MakeClcPath( clc, ccr, CL, Lg, -T)
EgtMove( CLC1, Point3d(0,L,T) - ORIG())
-- angolo x+y+
CLC2 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC2, Point3d(0,L,0), Z_AX(), -90)
EgtMove( CLC2, Point3d(W,0,0) - ORIG())
-- angolo x+y-
CLC3 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC3, Point3d(0,L,0), Z_AX(), 180)
EgtMove( CLC3, Point3d(W,-L,0) - ORIG())
-- angolo x-y-
CLC4 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC4, Point3d(0,L,0), Z_AX(), 90)
EgtMove( CLC4, Point3d(0,-L,0) - ORIG())
end
-- se ci sono i parametri per i percorsi di clean corner con utensile conico
if CLCN and ccn and ccn > 0 and dRadToClean and dRadToClean > 0 then
-- angolo x-y+
CLCN1 = MakeConeClcPath( CLCN, Lg, -T, dRadToClean, dConeCleanMode)
EgtMove( CLCN1, Point3d(0,L,T) - ORIG())
-- angolo x+y+
CLCN2 = EgtCopyGlob( CLCN1, Lg)
EgtRotate( CLCN2, Point3d(0,L,0), Z_AX(), -90)
EgtMove( CLCN2, Point3d(W,0,0) - ORIG())
-- angolo x+y-
CLCN3 = EgtCopyGlob( CLCN1, Lg)
EgtRotate( CLCN3, Point3d(0,L,0), Z_AX(), 180)
EgtMove( CLCN3, Point3d(W,-L,0) - ORIG())
-- angolo x-y-
CLCN4 = EgtCopyGlob( CLCN1, Lg)
EgtRotate( CLCN4, Point3d(0,L,0), Z_AX(), 90)
EgtMove( CLCN4, Point3d(0,-L,0) - ORIG())
end
if GId then
EgtModifyCurveThickness( GId, -T)
EgtInvertCurve( GId)
EgtSetName( GId, LG)
-- creo estrusi e superfici piane delle geometrie passanti
AddSurfTmByExtrusion(Lg, GId, bSingleMode)
end
end
-- Costruzione della geometria di lavorazione
if nDrawMach > 0 then -- se abilitata geometria lavorazione
-- Costruzione della geometria
MId = EgtRectangle2P( Lg, Point3d( 0, 0, T), Point3d( W, L, T), GDB_RT.GLOB)
if DGD.Lock == 'L' then
EgtChangeClosedCurveStartPoint( MId, Point3d( 0, L /2, T), GDB_RT.GLOB)
else
EgtChangeClosedCurveStartPoint( MId, Point3d( W, L /2, T), GDB_RT.GLOB)
end
EgtModifyCurveThickness( MId, -T)
EgtInvertCurve( MId)
if bl then
EgtSetName( MId, LBM)
EgtSetInfo( MId, 'ByBlade', bl)
else
EgtSetName( MId, LM)
end
-- se ci sono tutti i parametri per l'hatching
if DM and ( ( hml and dml) or dmw) then
local bMakeDrop = false
if not d then d = 0 end
-- se l'utensile e i parametri per la lunghezza sono presenti
if d > 0 and hml and dml then
-- se lunghezza inferiore del limite inserisco le linee
if L <= hml then
if L > dml then -- se lunghezza e' maggiore del drop inserisco linee
-- determino quante linee inserire
local nStep = ceil(L/dml) -- numero di passate
local dStep = (L/nStep) -- passo ricalcolato
local nPass = 1
local nDir = 1
bMakeDrop = true
bExistsHatching = bMakeDrop
-- ciclo inserimento linee
while nPass < nStep do
pIni = Point3d( EgtIf( nDir > 0, (d*9/16), (W-(d*9/16))),(dStep*nPass),T)
pEnd = Point3d( EgtIf( nDir > 0, (W-(d*9/16)), (d*9/16)),(dStep*nPass),T)
hint1 = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
-- se ho doppia linea
if dbl and dbl == 1 then
EgtTrimExtendCurveByLen( hint1, -(d/2), pEnd)
pIni = EgtSP( hint1)
pEnd = EgtEP( hint1)
-- seconda linea
hint2 = DrawAddLineDrawCircle( pEnd, pIni, Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
DRP1 = EgtCurveCompo( Lg, {hint1,hint2}, true)
else
DRP1 = EgtCurveCompo( Lg, hint1, true)
end
EgtModifyCurveThickness( DRP1, -T)
EgtSetName( DRP1, DM)
if dbl and dbl == 1 then
EgtSetInfo( DRP1, 'DoubleLine', 1)
end
-- creo estrusi e superfici attorno alla linea di drop
DrawRectangleAndMakeItsRegion( Lg, bPreview, Dm, DRP1, -T)
-- se non ho doppia linea creao linee di verso alternato
if not dbl or dbl == 0 then
nDir = -nDir
end
nPass = nPass + 1
end -- end while
end
end
end
if d > 0 and dmw then
-- se lunghezza inferiore del limite inserisco le linee
if L <= hml then
if W > dmw then -- se larghezza e' maggiore del drop inserisco linee
-- determino quante linee inserire
local nStep = ceil(W/dmw) -- numero di passate
local dStep = (W/nStep) -- passo ricalcolato
local nPass = 1
local nDir = 1
bMakeDrop = true
bExistsHatching = bMakeDrop
-- ciclo inserimento linee
while nPass < nStep do
pIni = Point3d( (dStep*nPass), EgtIf( nDir > 0, (d*9/16), (L-(d*9/16))),T)
pEnd = Point3d( (dStep*nPass), EgtIf( nDir > 0, (L-(d*9/16)), (d*9/16)),T)
hint1 = DrawAddLineDrawCircle( pIni, pEnd, Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
-- se ho doppia linea
if dbl and dbl == 1 then
EgtTrimExtendCurveByLen( hint1, -(d/2), pEnd)
pIni = EgtSP( hint1)
pEnd = EgtEP( hint1)
-- seconda linea
hint2 = DrawAddLineDrawCircle( pEnd, pIni, Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
DRP1 = EgtCurveCompo( Lg, {hint1,hint2}, true)
else
DRP1 = EgtCurveCompo( Lg, hint1, true)
end
EgtModifyCurveThickness( DRP1, -T)
EgtSetName( DRP1, DM)
if dbl and dbl == 1 then
EgtSetInfo( DRP1, 'DoubleLine', 1)
end
-- creo estrusi e superfici attorno alla linea di drop
DrawRectangleAndMakeItsRegion( Lg, bPreview, Dm, DRP1, -T)
-- se non ho doppia linea creao linee di verso alternato
if not dbl or dbl == 0 then
nDir = -nDir
end
nPass = nPass + 1
end -- end while
end
end
end
end
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if GId then
EgtSetColor( GId or GDB_ID.NULL, AQUA())
end
if MId then
EgtSetColor( MId or GDB_ID.NULL, AQUA())
end
if CLC1 then
EgtSetColor( CLC1 or GDB_ID.NULL, AQUA())
end
if CLC2 then
EgtSetColor( CLC2 or GDB_ID.NULL, AQUA())
end
if CLC3 then
EgtSetColor( CLC3 or GDB_ID.NULL, AQUA())
end
if CLC4 then
EgtSetColor( CLC4 or GDB_ID.NULL, AQUA())
end
else
if GId then
EgtSetColor( GId or GDB_ID.NULL, ORANGE())
end
if MId then
EgtSetColor( MId or GDB_ID.NULL, ORANGE())
end
if CLC1 then
EgtSetColor( CLC1 or GDB_ID.NULL, ORANGE())
end
if CLC2 then
EgtSetColor( CLC2 or GDB_ID.NULL, ORANGE())
end
if CLC3 then
EgtSetColor( CLC3 or GDB_ID.NULL, ORANGE())
end
if CLC4 then
EgtSetColor( CLC4 or GDB_ID.NULL, ORANGE())
end
end
end
-- Se non Preview
-- (NOTA : se ci sono errori il componente non viene eseguito dal programma di gestione dei componenti)
if not bPreview and EC == 0 then
if bRunByCompo then
-- scrivo i parametri nelle info del pezzo
WriteCompoDataToPart(Pz,sCompoName,nCompoNpar)
end
-- scrivo note nel layer
EgtSetInfo( Lg, 'Type' , 'LouverCutOut')
EgtSetInfo( Lg, 'L' , L)
EgtSetInfo( Lg, 'H' , H)
EgtSetInfo( Lg, 'T' , T)
EgtSetInfo( Lg, 'clc' , clc)
EgtSetInfo( Lg, 'ccr' , ccr)
EgtSetInfo( Lg, 'ccn' , ccn)
EgtSetInfo( Lg, 'hml' , hml)
EgtSetInfo( Lg, 'dml' , dml)
EgtSetInfo( Lg, 'dmw' , dmw)
EgtSetInfo( Lg, 'bl' , bl)
EgtSetInfo( Lg, 'dbl' , dbl)
EgtSetInfo( Lg, 'd' , d)
EgtSetInfo( Lg, 'd3' , d3)
EgtSetInfo( Lg, 'est' , est)
EgtSetInfo( Lg, 'hatch' , bExistsHatching)
EgtSetInfo( Lg, 'LG' , LG)
EgtSetInfo( Lg, 'LM' , LM)
EgtSetInfo( Lg, 'CL' , CL)
EgtSetInfo( Lg, 'CLCN' , CLCN)
EgtSetInfo( Lg, 'DM' , DM)
EgtSetInfo( Lg, 'LBM' , LBM)
EgtSetInfo( Lg, 'Path' , sCompoPath)
end
if EC == 0 and nCodAdj and nCodAdj < 0 then
EC = nCodAdj
EM = sCodAdj
end
return EC, EM, Lg
end
return LouverCutOut
File diff suppressed because it is too large Load Diff
+493
View File
@@ -0,0 +1,493 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- MailSlot.lua by EgalWare s.r.l. 2016.07.05
-- Autore: Filippo Monchi
-- Mail SLot dati i valori 'L' e 'T' e con nome attributo e dati dei fori
-- 2016.07.05 V1.000 FM First version
-- 2019.10.02 V1.001 FM Manage steel option (disable generation of some geometries)
-- 2019.10.17 V1.002 FM Manage cut by saw and steel option (for this component it doesn't anything)
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2020.04.29 V2.001 FM Update for aluminum material
-- 2022.07.27 V2.002 FM Modification to use compiled code
-- Tavola per definizione modulo (serve ma non usata)
local MailSlot = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Valori limite
local DimMin = 4. -- valore minimo lato
local function GetMachToolErrorMessage( nErrorId, sGeomName, dIdMach, dOriDiamTool, nIdLogErr, sMchngName)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local sMessage = ''
if dOriDiamTool then
if nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[466], nIdLogErr, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -2 then -- errore nel settare la lavorazione, lavorazione non presente in libreria
sMessage = string.format(EgtDoorsMsg[467], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[468], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[469], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[470], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[471], nIdLogErr, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[472], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
elseif nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[504], nIdLogErr, dIdMach, sGeomName)
elseif nErrorId == -2 then -- errore nel settare la lavorazione
sMessage = string.format(EgtDoorsMsg[505], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[506], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[507], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[508], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[503], nIdLogErr, sGeomName)
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[473], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
return sMessage
end
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc, nRad, bDrawFirst, bDrawLast, cColor1, cColor2)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
if idTable then
table.insert( idTable, nLine)
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor(nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor(nCircle2, cColor2)
end
end
return nLine
end
-- Funzione di sistemazione parametri
function MailSlot.AdjustParams( tMhPar)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local dMaxMat0
local dNumMessage
local dNumLog = 0
local sMessToOut = ''
local nTempT0
local sMchngName0
local nThBl0
-- Assegno parametri da ddf
if DGD.LENGTH then
tMhPar.L = DGD.LENGTH
end
tMhPar.T = DGD.dT
if tMhPar.IL then
tMhPar.IL = tMhPar.IL + DGD.LENGTH
end
if tMhPar.DD then
if tMhPar.DD == -0.5 then
tMhPar.DD = DGD.dT / 2
elseif tMhPar.DD == -1 then
tMhPar.DD = DGD.dT
end
end
-- disattivo la lama se la cava è più profonda di una certa quota
if tMhPar.MaxBd and tMhPar.T and tMhPar.T > tMhPar.MaxBd then
tMhPar.bl = false
dNumLog = -1394
dNumMessage = 674
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(tMhPar.MaxBd))
end
-- Assegno parametri da dati utensili in macchina
local MB = require( 'MachiningBase')
local sLBM
local nLBMi = 1
local dMaxCutBladeLen = 0
-- se porta steel o aluminum
if FindMaterial( DGD.Material, 'steel') or FindMaterial( DGD.Material, 'aluminum') then
tMhPar.est = true
else
tMhPar.est = nil
end
if tMhPar.LBM then -- geometria con lama
sLBM = tMhPar.LBM
end
-- se devo disegnare le geometrie di lavorazione
if DGD.MachEn > 0 then
if sLBM and tMhPar.bl and tMhPar.d3 then
nTempT0, dMaxMat0, sMchngName0, nThBl0 = MB.GetToolDataFromAttrib( sLBM, nLBMi)
end
if tMhPar.d3 and nTempT0 and nTempT0 <= 0 then -- lama
if DGD.bProoduce and tMhPar.bl then -- se utilizzo la lama
dNumLog = -1399
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT0, sLBM, nLBMi, tMhPar.d3, dNumLog, sMchngName0)
end
elseif nTempT0 then
tMhPar.d3 = nTempT0
if nThBl0 and nThBl0 > 0 then tMhPar.thb = nThBl0 end
end
-- se lo spessore porta è maggiore della capacità lama disabilito la lama ed emetto un warning
if tMhPar.bl and tMhPar.T and dMaxMat0 and tMhPar.T >= dMaxMat0 then
tMhPar.bl = false
tMhPar.LBM = nil
dNumLog = -1397
dNumMessage = 672
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sMchngName0, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat0))
end
-- se il blade è attivo calcolo se passa la lama nella sfinestratura
if tMhPar.bl and tMhPar.d3 and tMhPar.L and tMhPar.W then
-- calcolo la massima impronta lama
local dBladeRadius = tMhPar.d3 / 2
dMaxCutBladeLen = sqrt( (dBladeRadius * dBladeRadius) - ( ( dBladeRadius - tMhPar.T) * ( dBladeRadius - tMhPar.T)))
-- se l'impronta lama è maggiore della lunghezza o larghezza escludo la lama e do messaggio di warning
if (2*dMaxCutBladeLen) >= tMhPar.L or (2*dMaxCutBladeLen) >= tMhPar.W then
tMhPar.bl = false
tMhPar.LBM = nil
dNumLog = -1395
dNumMessage = 673
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sMchngName0)
end
end
-- se il blade è attivo e utensile lama e c'è il clean corner, lo ricalcolo in funzione del raggio lama
if tMhPar.bl and tMhPar.thb and tMhPar.thb > 0 and tMhPar.clc and tMhPar.clc > 0 then
if dMaxCutBladeLen > tMhPar.clc then
tMhPar.clc = dMaxCutBladeLen
end
end
if tMhPar.CL and tMhPar.clc and tMhPar.clc > 0 and ( tMhPar.clc >= tMhPar.W or tMhPar.clc >= tMhPar.L) then
tMhPar.clc = nil
elseif not tMhPar.CL then
tMhPar.clc = nil
end
end
if dNumLog ~= 0 then
return tMhPar, dNumLog, sMessToOut
end
return tMhPar, 0, ''
end
-- Funzione di disegno
function MailSlot.Draw( tMlSlPar, bPreview, bRunByCompo, nDrawMach)
-- Assegno le dimensioni
local L = tMlSlPar.L
local W = tMlSlPar.W
local T = tMlSlPar.T
local clc = tMlSlPar.clc
local ccr = tMlSlPar.ccr
local bl = tMlSlPar.bl
local d3 = tMlSlPar.d3 -- blade diameter
local est = tMlSlPar.est
-- Assegno parametri fori
local ms = tMlSlPar.ms
local DS = tMlSlPar.DS
local DD = tMlSlPar.DD
local IL = tMlSlPar.IL
local IW = tMlSlPar.IW
-- Assegno i nomi
local LG = tMlSlPar.LG
local LM = tMlSlPar.LM
local SCU = tMlSlPar.SCU
local CL = tMlSlPar.CL
local LBM = tMlSlPar.LBM -- nome lavorazione con lama
-- variabili per messaggi e settaggi vari
local sCompoName = tMlSlPar.Nome
local nCompoNPar = tMlSlPar.Npar
local sCompoPath = tMlSlPar.Path
-- eventuale messaggio errore rilevato nell'adjust
local nCodAdj = tMlSlPar.nCod
local sCodAdj = tMlSlPar.sCod
-- variabili per messaggi e settaggi vari
local sNamePar1 = tMlSlPar.N1 or 'L'
local sNamePar2 = tMlSlPar.N2 or 'H'
local sNamePar3 = tMlSlPar.N3 or 'T'
local sNamePar4 = tMlSlPar.N4 or 'clc'
local sNamePar5 = tMlSlPar.N5 or 'ccr'
-- RunByComponentInterface
local RC = true
-- Messaggi codice errori
local EM = ' '
local EC = 0
local ErrorBase = 1300
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
-- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
local EgtDoorsMsg = require( 'EgtDoorsMsg')
-- Verifica delle dimensioni, le condizioni vengono verificate in base a quale geometria deve essere creata
if L < DimMin then
EC = 1
EM = string.format(EgtDoorsMsg[401],sNamePar1,EgtToUiUnits(DimMin), sCompoPath) -- il parametro 'L' deve essere > DimMin
D = DimMin
elseif W < DimMin then
EC = 2
EM = string.format(EgtDoorsMsg[401],sNamePar2,EgtToUiUnits(DimMin), sCompoPath) -- il parametro 'H' deve essere > DimMin
W = DimMin
elseif CL and clc and ccr and clc > 0 and ccr > 0 and (2*(ccr*sin(45))) >= clc then
EC = 3
EM = string.format(EgtDoorsMsg[407],sNamePar4,EgtToUiUnits(clc),'',EgtToUiUnits(2*(ccr*sin(45))), sCompoPath) -- il parametro 'clc' deve essere > 'crc'
clc = (2*(ccr*sin(45)))+0.2
end
if not bPreview and EC ~= 0 then
return (ErrorBase+EC), EM
end
-- Se Preview cancello tutto
if bPreview then
EgtNewFile()
EgtSetDefaultMaterial( BLACK())
end
-- Pezzo e Layer
local Pz
if bPreview then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
else
if not RC then
Pz = EgtGetCurrPart() -- pezzo corrente
end
if not Pz then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
end
end
local Lg
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName(Lg,sCompoName)
local GId, MId, hint_1, hint_2, hint_3, hint_4
local bSingleMode = true
-- Costruzione della geometria
GId = EgtRectangle2P( Lg, Point3d( -(W/2), 0, T), Point3d( (W/2), L, T), GDB_RT.GLOB)
EgtModifyCurveThickness( GId, -T)
EgtInvertCurve( GId)
EgtSetName( GId, LG)
EgtSetInfo( GId,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
-- creo estrusi e superfici piane delle geometrie passanti
AddSurfTmByExtrusion( Lg, GId, bSingleMode)
if ms then -- se devo fare le viti
if DS and DD and IL and IW then
-- se dimensioni foro vite idonee
if DS > 0 and DD ~= 0 then
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
hint_1 = EgtCircle( Lg, Point3d( -(IW/2),-((IL-L)/2),T), DS/2 , GDB_RT.LOC)
hint_2 = EgtCircle( Lg, Point3d( -(IW/2),(L+((IL-L)/2)),T), DS/2 , GDB_RT.LOC)
hint_3 = EgtCircle( Lg, Point3d( (IW/2),(L+((IL-L)/2)),T), DS/2 , GDB_RT.LOC)
hint_4 = EgtCircle( Lg, Point3d( (IW/2),-((IL-L)/2),T), DS/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_1, -DD)
EgtModifyCurveThickness(hint_2, -DD)
EgtModifyCurveThickness(hint_3, -DD)
EgtModifyCurveThickness(hint_4, -DD)
EgtSetName(hint_1,SCU)
EgtSetName(hint_2,SCU)
EgtSetName(hint_3,SCU)
EgtSetName(hint_4,SCU)
EgtSetInfo(hint_1,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo(hint_2,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo(hint_3,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo(hint_4,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
-- creo estrusi e superfici piane delle geometrie passanti
AddSurfTmByExtrusion( Lg, hint_1, bSingleMode)
AddSurfTmByExtrusion( Lg, hint_2, bSingleMode)
AddSurfTmByExtrusion( Lg, hint_3, bSingleMode)
AddSurfTmByExtrusion( Lg, hint_4, bSingleMode)
end
end
end
-- Costruzione della geometria clean corner
if nDrawMach >= 0 then -- se abilitata geometria
-- se ci sono i parametri per i percorsi clean corner
if CL and clc and clc > 0 and clc < W and clc < L then
-- angolo x-y+
local CLC1 = MakeClcPath( clc, ccr, CL, Lg, -T)
EgtMove( CLC1, Point3d(-(W/2),L,T) - ORIG())
-- angolo x+y+
local CLC2 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC2, Point3d(-(W/2),L,0), Z_AX(), -90)
EgtMove( CLC2, Point3d(W,0,0) - ORIG())
-- angolo x+y-
CLC2 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC2, Point3d(-(W/2),L,0), Z_AX(), 180)
EgtMove( CLC2, Point3d(W,-L,0) - ORIG())
-- angolo x-y-
CLC2 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC2, Point3d(-(W/2),L,0), Z_AX(), 90)
EgtMove( CLC2, Point3d(0,-L,0) - ORIG())
end
end
-- Costruzione della geometria di lavorazione
if nDrawMach > 0 then -- se abilitata geometria lavorazione
-- Costruzione della geometria
MId = EgtRectangle2P( Lg, Point3d( -(W/2), 0, T), Point3d( (W/2), L, T), GDB_RT.GLOB)
EgtChangeClosedCurveStartPoint( MId, Point3d( 0, 0, T), GDB_RT.GLOB)
EgtModifyCurveThickness( MId, -T)
EgtInvertCurve( MId)
if bl then
EgtSetName( MId, LBM)
EgtSetInfo( MId, 'ByBlade', bl)
else
EgtSetName( MId, LM)
end
EgtSetInfo( MId,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if GId then
EgtSetColor( GId or GDB_ID.NULL, AQUA())
end
if MId then
EgtSetColor( MId or GDB_ID.NULL, AQUA())
end
if hint_1 then
EgtSetColor( hint_1 or GDB_ID.NULL, AQUA())
end
if hint_2 then
EgtSetColor( hint_2 or GDB_ID.NULL, AQUA())
end
if hint_3 then
EgtSetColor( hint_3 or GDB_ID.NULL, AQUA())
end
if hint_4 then
EgtSetColor( hint_4 or GDB_ID.NULL, AQUA())
end
else
if GId then
EgtSetColor( GId or GDB_ID.NULL, ORANGE())
end
if MId then
EgtSetColor( MId or GDB_ID.NULL, ORANGE())
end
if hint_1 then
EgtSetColor( hint_1 or GDB_ID.NULL, ORANGE())
end
if hint_2 then
EgtSetColor( hint_2 or GDB_ID.NULL, ORANGE())
end
if hint_3 then
EgtSetColor( hint_3 or GDB_ID.NULL, ORANGE())
end
if hint_4 then
EgtSetColor( hint_4 or GDB_ID.NULL, ORANGE())
end
end
end
-- Se non Preview
-- (NOTA : se ci sono errori il componente non viene eseguito dal programma di gestione dei componenti)
if not bPreview then
if bRunByCompo then
-- scrivo i parametri nelle info del pezzo
WriteCompoDataToPart(Pz,sCompoName,nCompoNPar)
end
-- scrivo note nel layer della cerniera
EgtSetInfo(Lg,'Type' ,'MailSlot')
EgtSetInfo(Lg,'L' ,L)
EgtSetInfo(Lg,'H' ,H)
EgtSetInfo(Lg,'T' ,T)
EgtSetInfo(Lg,'ms' ,ms)
EgtSetInfo(Lg,'clc' ,clc)
EgtSetInfo(Lg,'ccr' ,ccr)
EgtSetInfo(Lg,'bl' ,bl)
EgtSetInfo(Lg,'d3' ,d3)
EgtSetInfo(Lg,'est' ,est)
EgtSetInfo(Lg,'DS' ,DS)
EgtSetInfo(Lg,'DD' ,DD)
EgtSetInfo(Lg,'IL' ,IL)
EgtSetInfo(Lg,'IW' ,IW)
EgtSetInfo(Lg,'LG' ,LG)
EgtSetInfo(Lg,'LM' ,LM)
EgtSetInfo(Lg,'SCU' ,SCU)
EgtSetInfo(Lg,'LBM' ,LBM)
EgtSetInfo(Lg,'Path' ,sCompoPath)
end
if EC == 0 and nCodAdj and nCodAdj < 0 then
EC = nCodAdj
EM = sCodAdj
end
return EC, EM, Lg
end
return MailSlot
+55
View File
@@ -0,0 +1,55 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- Main_Assemb_l.lua by EgalWare s.r.l. 2016.05.28
-- Main disposizione assemblato a raggruppamento
-- Intestazioni
EgtEnableDebug( false)
-----------------------------------------------------------------
local function InteractiveChoice()
-- chiedo dato all'iutente
local tsDisp = EgtDialogBox( ' 0 = dispose, 1 = assembled, 2 = explode', {'disp mode:', '0'})
local sDisp = '0'
local nDisposeMain = 0
if tsDisp then
sDisp = tsDisp[1]
end
if sDisp ~= nil then
if sDisp == '0' then nDisposeMain = 0
elseif sDisp == '1' then nDisposeMain = 1
elseif sDisp == '2' then nDisposeMain = 2
else nDisposeMain = 0 end
end
local sRequireCompoName = '_AssemblyDisp'
-- lancio il componente base
local MHgen = require( sRequireCompoName)
local bOkD = MHgen.AssemblyDispose( nDisposeMain)
return bOkD
end
-----------------------------------------------------------------
-- *** Main function ***
-----------------------------------------------------------------
local sNgeFile = EgtGetCurrFilePath()
InteractiveChoice()
EgtDraw()
EgtSaveFile( sNgeFile)
return true
+47
View File
@@ -0,0 +1,47 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- Main_Assemply.lua by EgalWare s.r.l. 2016.05.28
-- Main disposizione assemblato a raggruppamento
-- 2022.07.27 V1.002 FM Modification to use compiled code
-- Tavola per definizione modulo (serve ma non usata)
local Main_Assembly = {}
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
local sBaseDir = DGD.BASEDIR -- EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-----------------------------------------------------------------
-- *** Main function ***
-----------------------------------------------------------------
function Main_Assembly.main( nDisposeMain)
local sNgeFile = EgtGetCurrFilePath()
local sRequireCompoName = '_AssemblyDisp'
-- lancio il componente base
local MHgen = require( sRequireCompoName)
local bOkD = MHgen.AssemblyDispose( nDisposeMain)
EgtDraw()
EgtSaveFile( sNgeFile)
return true
end
return Main_Assembly
File diff suppressed because it is too large Load Diff
+812
View File
@@ -0,0 +1,812 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- OverHead.lua by EgalWare s.r.l. 2016.06.29
-- Autore: Filippo Monchi
-- Over Head Arm dati i valori 'L' e 'H' e 'T' e 'd' e 'p' e 'DS' e con nomi attributi
-- 2016.09.21 V1.0a1 FM Add warning messages
-- 2018.04.05 V1.0a2 FM Manage info (KeepBackSet) for adjust probe on Z
-- 2018.10.17 V1.0a3 FM Add parameter to show into message 402
-- 2018.11.15 V1.0a4 FM Manage latch strike option
-- 2018.11.15 V1.0a4 FM Manage Y shift from door side
-- 2018.11.15 V1.0a4 FM Manage face thru the thickness (only when it strike) and double anti-splint paths
-- 2018.12.10 V1.0a5 FM Manage geometry for calculate box without Arm volume (when strike)
-- 2019.10.16 V1.0a6 FM Manage steel option (disable generation of some geometries)
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.10.30 V2.001 FM Add clean corner geometries
-- 2020.04.29 V2.002 FM Update for aluminum material
-- 2021.01.22 V3.000 FM Manage better checking error on tools and dimension when produce flag is false
-- 2021.11.24 V3.001 FM Manage side probe option if variable DGC.Pms > 2
-- 2022.07.27 V3.002 FM Modification to use compiled code
-- Tavola per definizione modulo (serve ma non usata)
local OverHead = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Valori limite
local DgMin = 4. -- valore minimo diametro utensile
local PtMin = 0.1
local PtMax = 1.0
local function GetMachToolErrorMessage( nErrorId, sGeomName, dIdMach, dOriDiamTool, nIdLogErr, sMchngName)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local sMessage = ''
if dOriDiamTool then
if nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[466], nIdLogErr, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -2 then -- errore nel settare la lavorazione, lavorazione non presente in libreria
sMessage = string.format(EgtDoorsMsg[467], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[468], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[469], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[470], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[471], nIdLogErr, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[472], nIdLogErr, sMchngName, dIdMach, sGeomName, EgtToUiUnits( dOriDiamTool))
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
elseif nErrorId == -1 then -- lavorazione non presente in tabella
sMessage = string.format(EgtDoorsMsg[504], nIdLogErr, dIdMach, sGeomName)
elseif nErrorId == -2 then -- errore nel settare la lavorazione
sMessage = string.format(EgtDoorsMsg[505], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -3 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[506], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -4 then -- errore nell'acquisire parametri lavorazione
sMessage = string.format(EgtDoorsMsg[507], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -5 then -- diametro utensile non trovato
sMessage = string.format(EgtDoorsMsg[508], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -6 then -- nome geometria non presente in tabella
sMessage = string.format(EgtDoorsMsg[503], nIdLogErr, sGeomName)
elseif nErrorId == -7 then -- altezza massima utensile non trovata
sMessage = string.format(EgtDoorsMsg[473], nIdLogErr, sMchngName, dIdMach, sGeomName)
elseif nErrorId == -8 then -- tabella non presente nelle note
sMessage = string.format(EgtDoorsMsg[509], nIdLogErr)
end
return sMessage
end
-- Funzione di sistemazione parametri
function OverHead.AdjustParams( tMhPar)
local EgtDoorsMsg = require( 'EgtDoorsMsg')
local dMaxMat0
local dMaxMat1
local dMaxMat2
local dMaxMat3
local dNumMessage
local dNumLog = 0
local sMessToOut = ''
local nTempT0
local nTempT1
local nTempT2
local nTempT3
local sMchngName0
local sMchngName1
local sMchngName2
local sMchngName3
tMhPar.fht = 0 -- setto il face h top a 0
tMhPar.fhb = 0 -- setto il face h bottom a 0
-- se non ho parametro step o è 0 lo assegno uguale allo spessore cava
if not tMhPar.sf or abs(tMhPar.sf) < GEO.EPS_SMALL then
tMhPar.sf = tMhPar.T
end
-- se non ho il parametro lo setto disattivato
if not tMhPar.ech then
tMhPar.ech = false
end
-- se non c'è la variabile suffisso del chisel
if not tMhPar.CH then
tMhPar.CH = '_Chisel'
end
-- se non c'è la variabile che indica al face di sbordare
if tMhPar.ls == nil then
tMhPar.ls = true
end
-- se altezza cava maggiore o uguale dello spessore porta la risetto come spessore porta
-- e disabilito il chisel e il clean corner
tMhPar.bETh = false
if ( tMhPar.H - DGD.dT) >= GEO.EPS_SMALL then
tMhPar.H = DGD.dT
tMhPar.ech = false -- disattivo il chisel
tMhPar.rf = 0 -- disattivo il radius face
tMhPar.bETh = true
tMhPar.ls = true
tMhPar.clc = nil
tMhPar.CLC = nil
-- do errore se altezza cava maggiore o uguale dello spessore porta
-- return tMhPar, 2399, string.format(EgtDoorsMsg[432], tMhPar.Nome, tMhPar.H, DGD.dT, tMhPar.Path)
end
if not tMhPar.DY or tMhPar.DY == 0 then -- se non c'è il parametro spostamento o è a 0
tMhPar.DY = 0
if not tMhPar.ls and tMhPar.H then -- se non sborda (latch strike) lo setto per stare in centro allo spessore porta
tMhPar.DY = (DGD.dT - tMhPar.H) / 2
end
end
-- Assegno parametri da ddf
if DGD.ARMLENGTH then
tMhPar.L = DGD.ARMLENGTH
end
if DGD.ARMPOS then
tMhPar.DS = 0
end
if DGD.POCKLENGTH then
tMhPar.L2 = DGD.POCKLENGTH
end
if DGD.POCKPOS then
tMhPar.DS2 = 0
end
if DGD.POCKET_OFFSET then -- se esiste offset in Z ne prendo il valore assoluto
DGD.POCKET_OFFSET = abs(DGD.POCKET_OFFSET)
end
if DGD.ARMPOS <= GEO.EPS_SMALL and tMhPar.DS <= GEO.EPS_SMALL then
if DGD.Lock == 'L' then
tMhPar.OS = 1
else
tMhPar.OS = -1
end
-- inverto il valore perché il bordo a filo si trova dal lato opposto
if DGD.Push then
tMhPar.OS = - tMhPar.OS
end
else
tMhPar.OS = 0
end
-- Assegno parametri da dati utensili in macchina
local MB = require( 'MachiningBase')
local sLM
local nLMi = 1
local sLA
local nLAi = 1
local sLMM
local nLMMi = 1
local sLG
local nLGi = 1
-- se porta steel o aluminum disabilito l'antischeggia, la svuotatura, il chisel e modifico il nome geometria
if FindMaterial( DGD.Material, 'steel') or FindMaterial( DGD.Material, 'aluminum') then
tMhPar.LM = nil
tMhPar.LA = nil
tMhPar.ech = false
tMhPar.CH = nil
tMhPar.est = true
tMhPar.d2 = nil
tMhPar.LGM = nil
tMhPar.LMM = nil
else
tMhPar.est = nil
end
if tMhPar.est and tMhPar.LG then
sLG = tMhPar.LG
if DGD.MachEn > 0 and tMhPar.d then nTempT0, dMaxMat0, sMchngName0 = MB.GetToolDataFromAttrib( sLG, nLGi) end
end
if tMhPar.LM then -- geometria arm
sLM = tMhPar.LM
if DGD.MachEn > 0 and tMhPar.d then nTempT1, dMaxMat1, sMchngName1 = MB.GetToolDataFromAttrib( sLM, nLMi) end
end
if tMhPar.LA then -- geometria antischeggia arm
sLA = tMhPar.LA
if DGD.MachEn > 0 and tMhPar.d2 then nTempT2, dMaxMat2, sMchngName2 = MB.GetToolDataFromAttrib( sLA, nLAi) end
end
if tMhPar.LMM then -- geometria pocket
sLMM = tMhPar.LMM
if DGD.MachEn > 0 and tMhPar.d3 then nTempT3, dMaxMat3, sMchngName3 = MB.GetToolDataFromAttrib( sLMM, nLMMi) end
end
if tMhPar.ech and tMhPar.LG then -- se chisel abilitato
sLG = tMhPar.LG .. tMhPar.CH
tMhPar.d0 = 0
if DGD.MachEn > 0 and tMhPar.d0 then nTempT0, dMaxMat0, sMchngName0 = MB.GetToolDataFromAttrib( sLG, nLGi) end
end
-- se devo disegnare le geometrie di lavorazione
if DGD.MachEn > 0 then
-- gestisco il risultato della lettura utensili
if DGD.bProoduce and tMhPar.est and tMhPar.d and nTempT0 and nTempT0 <= 0 then
dNumLog = -2394
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT0, sLG, nLGi, tMhPar.d, dNumLog, sMchngName0)
elseif tMhPar.est and nTempT0 then
tMhPar.d = nTempT0
end
--------------------------------------------------------------------------------
-- se c'è materiale steel faccio in modo che non assegni il diametro utensile
--------------------------------------------------------------------------------
-- gestisco il risultato della lettura utensili
if DGD.bProoduce and not tMhPar.est and tMhPar.d and nTempT1 and nTempT1 <= 0 then
dNumLog = -2396
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT1, sLM, nLMi, tMhPar.d, dNumLog, sMchngName1)
elseif not tMhPar.est and nTempT1 then
tMhPar.d = nTempT1
end
if DGD.bProoduce and not tMhPar.est and tMhPar.d2 and nTempT2 and nTempT2 <= 0 then
dNumLog = -2396
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT2, sLA, nLAi, tMhPar.d2, dNumLog, sMchngName2)
elseif not tMhPar.est and nTempT2 then
tMhPar.d2 = nTempT2
end
if DGD.bProoduce and not tMhPar.est and tMhPar.d3 and nTempT3 and nTempT3 <= 0 then
dNumLog = -2396
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT3, sLMM, nLMMi, tMhPar.d3, dNumLog, sMchngName3)
elseif not tMhPar.est and nTempT3 then
tMhPar.d3 = nTempT3
end
end
-- Regola applicazione chiseling:
-- se ho impostato un raccordo, anche se poi viene annullato perchè inferiore del raggio fresa
-- disabilito il chiseling perchè implica che se c'è un valore di raccordo non devo fare il chiseling
-- se ho il raggio valido disabilito il chiseling e il clean corner
if tMhPar.rf and tMhPar.rf > 0 then
tMhPar.ech = false
tMhPar.clc = nil
tMhPar.CLC = nil
else -- se non è definito o già nullo lo azzero
tMhPar.rf = 0
end
-- se devo disegnare le geometrie di lavorazione
if DGD.MachEn > 0 then
-- Raggio: se altro materiale e raggio presente e se raggio minore del diametro utensile + delta, lo annullo
if tMhPar.est and tMhPar.rf and tMhPar.rf > 0 and tMhPar.d and tMhPar.rf < ((tMhPar.d/2)+0.02) then
tMhPar.rf = 0
end
-- chiseling
if tMhPar.ech and tMhPar.d0 and nTempT0 > 0 then
tMhPar.d0 = nTempT0
end
-- se la profondità della arm per steel è maggiore della capacità utensile limito la profondità ed emetto un warning
if tMhPar.est and tMhPar.T and dMaxMat0 and tMhPar.T > dMaxMat0 then
dNumLog = -2393
dNumMessage = 460
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat0))
tMhPar.T = dMaxMat0
end
-- se la profondità della arm è maggiore della capacità utensile limito la profondità ed emetto un warning
if tMhPar.T and dMaxMat1 and tMhPar.T > dMaxMat1 then
dNumLog = -2398
dNumMessage = 460
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat1))
tMhPar.T = dMaxMat1 - 0.05 -- tolgo 0.05 per permettere la lavorazione
end
-- se la profondità antischeggia della arm è maggiore della capacità utensile limito la profondità ed emetto un warning
if tMhPar.T and dMaxMat2 and tMhPar.T > dMaxMat2 then
dNumLog = -2397
dNumMessage = 462
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat2))
tMhPar.T = dMaxMat2 - 0.05 -- tolgo 0.05 per permettere la lavorazione
end
if tMhPar.T and tMhPar.T > 0 and tMhPar.ls then
tMhPar.fht = tMhPar.T
tMhPar.fhb = tMhPar.fht
end
-- se la profondità della pocket è maggiore della capacità utensile limito la profondità ed emetto un warning
if tMhPar.T2 and dMaxMat3 and tMhPar.T2 > dMaxMat3 then
dNumLog = -2395
dNumMessage = 461
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T2), EgtToUiUnits(dMaxMat3))
tMhPar.T2 = dMaxMat3
end
if tMhPar.CLC and tMhPar.clc and tMhPar.clc > 0 and ( tMhPar.clc >= tMhPar.H or tMhPar.clc >= tMhPar.L) then
tMhPar.clc = nil
elseif not tMhPar.CLC then
tMhPar.clc = nil
end
end
if dNumLog ~= 0 then
return tMhPar, dNumLog, sMessToOut
end
return tMhPar, 0, ''
end
-- Funzione di disegno
function OverHead.Draw( tOHead, bPreview, bRunByCompo, nDrawMach, dThickDoor)
-- Assegno le dimensioni
local L = tOHead.L
local H = tOHead.H
local T = tOHead.T
local R = tOHead.rf
local clc = tOHead.clc
local ccr = tOHead.ccr
local d = tOHead.d
local p = tOHead.p
local sf = tOHead.sf
local d2 = tOHead.d2
local DS = tOHead.DS
local OS = tOHead.OS
local L2 = tOHead.L2
local H2 = tOHead.H2
local T2 = tOHead.T2
local d3 = tOHead.d3
local p3 = tOHead.p3
local s = tOHead.s
local DS2 = tOHead.DS2
local ech = tOHead.ech -- abilitazione chisel
local bEqualTh = tOHead.bETh
local ls = tOHead.ls
local fht = tOHead.fht
local fhb = tOHead.fhb
local est = tOHead.est
local kbs = tOHead.kbs -- keep backset/thickness (0: none, 1: only face, 2: all)
local pbs = tOHead.pbs
local DY = tOHead.DY
local cl = 0
local invG = 1
-- Assegno i nomi geometrie
local LG = tOHead.LG -- nome geometria arm
local LM = tOHead.LM -- nome lavorazione arm
local LA = tOHead.LA -- nome geometria antischeggia
local LGM = tOHead.LGM -- nome geometria pocket
local LMM = tOHead.LMM -- nome lavorazione pocket
local CH = tOHead.CH -- nome suffisso lavorazione chisel
local CLC = tOHead.CLC -- nome geometria clean corner
local DM = 'DUMMY'
-- variabili per messaggi e settaggi vari
local sCompoName = tOHead.Nome
local nCompoNpar = tOHead.Npar
local sCompoPath = tOHead.Path
-- eventuale messaggio errore rilevato nell'adjust
local nCodAdj = tOHead.nCod
local sCodAdj = tOHead.sCod
-- nomi parametri per messaggi
local sNamePar1 = tOHead.N1 or 'L'
local sNamePar2 = tOHead.N2 or 'H'
local sNamePar3 = tOHead.N3 or 'T'
local sNamePar4 = tOHead.N4 or 'd'
local sNamePar5 = tOHead.N5 or 'p'
local sNamePar6 = tOHead.N6 or 'd2'
local sNamePar7 = tOHead.N7 or 'DS'
local sNamePar8 = tOHead.N8 or 'OS'
local sNamePar9 = tOHead.N9 or 'sf'
local sNamePar10 = tOHead.N10 or 'L2'
local sNamePar11 = tOHead.N11 or 'H2'
local sNamePar12 = tOHead.N12 or 'T2'
local sNamePar13 = tOHead.N13 or 'd3'
local sNamePar14 = tOHead.N14 or 'p3'
local sNamePar15 = tOHead.N15 or 's'
local sNamePar16 = tOHead.N16 or 'DS2'
local sNamePar17 = tOHead.N17 or 'R'
local sNamePar18 = tOHead.N18 or 'clc'
local sNamePar19 = tOHead.N19 or 'ccr'
-- RunByComponetInterface
local RC = true
-- Messaggi codice errori
local EM = ' '
local EC = 0
local ErrorBase = 2300
-- variabili che abilitano la creazione della geometria
local bMakeFaceGeom = true
local bMakeMortGeom = true
-- variabili dei percorsi geometrici
local nGeom1, nGeom2, nAS1, nAS2
local nPkToJoin1, nPkToJoin2, nPkToJoin, nIdSideBoxUp
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
-- verifico se dei parametri sono nulli e in qual caso assegno dei valori sostitutivi
-- o setto la disabilitazione della creazione di alcune geometrie
if not L or not H then
bMakeFaceGeom = false
clc = nil
CLC = nil
end
if not T then
T = 0
end
-- se non sborda
if not ls then
DY = DY + H/2 -- compenso lo spostamento della metà cava
-- se c'è un raccordo setto per raccordare tutti gli angoli
if R and R > 0 then
cl = 3
end
end
if est or not L2 or not H2 then
bMakeMortGeom = false
end
if not T2 then
T2 = 0
end
-- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
local nForceMakeFace = nDrawMach
-- se ho abilitato il chiseling modifico il nome geometria
if ech then
LG = LG .. CH
tOHead.LG = LG
tOHead.smr = 1 -- inserisco i raccordini per non fare il chisel
-- se ho abilitato solo le geometrie di lavorazione, abilito la generazione di entrambe per il contorno chisel
if nDrawMach == 1 then
nForceMakeFace = 2
end
end
local EgtDoorsMsg = require( 'EgtDoorsMsg')
-- Verifica delle dimensioni, le condizioni vengono verificate in base a quale geometria deve essere creata
if bMakeFaceGeom and nDrawMach > 0 and d < DgMin then
EC = 1
EM = string.format(EgtDoorsMsg[400],sNamePar4,EgtToUiUnits(d),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
d = DgMin
elseif bMakeFaceGeom and nDrawMach > 0 and d2 and d2 < DgMin then
EC = 2
EM = string.format(EgtDoorsMsg[400],sNamePar6,EgtToUiUnits(d2),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
d2 = DgMin
elseif bMakeFaceGeom and H <= 0 then
EC = 3
EM = string.format(EgtDoorsMsg[401],sNamePar2,EgtToUiUnits(H), sCompoPath) -- il parametro 'H' deve essere > 0
H = d/2
elseif bMakeFaceGeom and nDrawMach > 0 and L <= d then
if DGD.bProoduce then
EC = 4
EM = string.format(EgtDoorsMsg[402],sNamePar1,EgtToUiUnits(L),sNamePar4,EgtToUiUnits(d), sCompoPath) -- il parametro 'L' deve essere maggiore al diametro utensile d
L = d + 0.002
else
d = L - 0.002
end
elseif bMakeFaceGeom and nDrawMach > 0 and d2 and L <= d2 then
if DGD.bProoduce then
EC = 5
EM = string.format(EgtDoorsMsg[402],sNamePar1,EgtToUiUnits(L),sNamePar6,EgtToUiUnits(d2), sCompoPath) -- il parametro 'L' deve essere maggiore al diametro utensile d2
L = d2 + 0.002
else
d2 = L - 0.002
end
elseif bMakeFaceGeom and nDrawMach > 0 and ( p < PtMin or p > PtMax) then
EC = 6
EM = string.format(EgtDoorsMsg[403],sNamePar5,p,PtMin,PtMax, sCompoPath) -- il parametro 'p' deve essere compreso tra
p = 0.8
elseif bMakeFaceGeom and T < 0 then
EC = 7
EM = string.format(EgtDoorsMsg[404],sNamePar3,EgtToUiUnits(T), sCompoPath) -- il parametro 'T' deve essere >= 0
T = 0
elseif bMakeFaceGeom and L <= 0 then
EC = 8
EM = string.format(EgtDoorsMsg[401],sNamePar1,EgtToUiUnits(L), sCompoPath) -- il parametro 'L' deve essere > 0
L = d
elseif bMakeFaceGeom and OS ~= 0 and OS ~= 1 and OS ~= -1 then
EC = 9
EM = string.format(EgtDoorsMsg[417],sNamePar8,OS, sCompoPath) -- il parametro 'OS' accetta solo valore: 0, 1 o -1
OS = 0
elseif bMakeFaceGeom and DS < 0 then
EC = 10
EM = string.format(EgtDoorsMsg[404],sNamePar7,EgtToUiUnits(DS), sCompoPath) -- il parametro 'DS' deve essere > 0
DS = 0
elseif bMakeMortGeom and nDrawMach > 0 and d3 < DgMin then
EC = 11
EM = string.format(EgtDoorsMsg[400],sNamePar13,EgtToUiUnits(d3),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
d3 = DgMin
elseif bMakeMortGeom and H2 <= 0 then
EC = 12
EM = string.format(EgtDoorsMsg[401],sNamePar11,EgtToUiUnits(H2), sCompoPath) -- il parametro 'H2' deve essere > 0
H2 = d3/2
elseif bMakeMortGeom and nDrawMach > 0 and L2 <= d3 then
if DGD.bProoduce then
EC = 13
EM = string.format(EgtDoorsMsg[402],sNamePar10,EgtToUiUnits(L2),sNamePar13,EgtToUiUnits(d3), sCompoPath) -- il parametro 'L2' deve essere maggiore al diametro utensile d3
L2 = d3 + 0.002
else
d3 = L2 - 0.002
end
elseif bMakeMortGeom and nDrawMach > 0 and ( p3 < PtMin or p3 > PtMax) then
EC = 14
EM = string.format(EgtDoorsMsg[403],sNamePar14,p3,PtMin,PtMax, sCompoPath) -- il parametro 'p3' deve essere compreso tra
p3 = 0.8
elseif bMakeMortGeom and T2 < 0 then
EC = 15
EM = string.format(EgtDoorsMsg[404],sNamePar12,EgtToUiUnits(T2), sCompoPath) -- il parametro 'T2' deve essere >= 0
T2 = 0
elseif bMakeMortGeom and L2 <= 0 then
EC = 16
EM = string.format(EgtDoorsMsg[401],sNamePar10,EgtToUiUnits(L2), sCompoPath) -- il parametro 'L' deve essere > 0
L2 = d3 + 0.002
elseif bMakeFaceGeom and nDrawMach > 0 and sf and sf <= 0 then
EM = string.format(EgtDoorsMsg[401],sNamePar9,EgtToUiUnits(sf), sCompoPath) -- il parametro 'sf' deve essere > 0
EC = 17
sf = d
elseif bMakeMortGeom and nDrawMach > 0 and s and s <= 0 then
EM = string.format(EgtDoorsMsg[401],sNamePar15,EgtToUiUnits(s), sCompoPath) -- il parametro 's' deve essere > 0
EC = 18
s = d3
elseif bMakeMortGeom and DS2 < 0 then
EC = 19
EM = string.format(EgtDoorsMsg[404],sNamePar16,EgtToUiUnits(DS2), sCompoPath) -- il parametro 'DS2' deve essere > 0
DS2 = 0
elseif bMakeFaceGeom and ls and R < 0 then
EC = 20
EM = string.format(EgtDoorsMsg[404],sNamePar17,EgtToUiUnits(R), sCompoPath) -- il parametro 'R' deve essere >= 0
R = d/2
elseif bMakeFaceGeom and R and L <= R*2 then
EC = 21
EM = string.format(EgtDoorsMsg[406],sNamePar17,EgtToUiUnits(R),sNamePar1..'/2',EgtToUiUnits(L/2), sCompoPath) -- il parametro 'R' deve essere < 'L/2'
L = (R*2)+1
elseif bMakeFaceGeom and ls and R >= H then
EC = 22
EM = string.format(EgtDoorsMsg[406],sNamePar17,EgtToUiUnits(R),sNamePar2,EgtToUiUnits(H), sCompoPath) -- il parametro 'R' deve essere < H
R = d/2
elseif bMakeFaceGeom and not ls and H < d then
if DGD.bProoduce then
EC = 23
EM = string.format(EgtDoorsMsg[405],sNamePar2,EgtToUiUnits(H),EgtToUiUnits(d), sCompoPath) -- il parametro 'H' deve essere maggiore o uguale del diametro utensile
H = d
else
d = H - 0.002
end
elseif bMakeFaceGeom and not ls and R and H <= R*2 then
EC = 24
EM = string.format(EgtDoorsMsg[406],sNamePar17,EgtToUiUnits(R),sNamePar2..'/2',EgtToUiUnits(H/2), sCompoPath) -- il parametro 'R' deve essere < H/2
R = H/2
elseif bMakeFaceGeom and not ls and cl > 0 and R and R < 0 then
EC = 25
EM = string.format(EgtDoorsMsg[404],sNamePar17,EgtToUiUnits(R), sCompoPath) -- il parametro 'R' deve essere >= 0
R = H/2
elseif bMakeFaceGeom and not ls and cl > 0 and R and abs(R - (H/2)) < GEO.EPS_SMALL and L <= H then
EC = 26
EM = string.format(EgtDoorsMsg[407],sNamePar1,EgtToUiUnits(L),sNamePar2,EgtToUiUnits(H), sCompoPath) -- il parametro 'L' deve essere > 'H'
L = H+5
elseif bMakeFaceGeom and not ls and cl > 0 and R and R < (H/2) and L <= (R*2) then
EC = 27
EM = string.format(EgtDoorsMsg[407],sNamePar1,EgtToUiUnits(L),sNamePar17..'*2',EgtToUiUnits(R*2), sCompoPath) -- il parametro 'L' deve essere > 'R*2'
L = (R*2)+5
elseif bMakeFaceGeom and CLC and clc and ccr and clc > 0 and ccr > 0 and (2*(ccr*sin(45))) >= clc then
EC = 28
EM = string.format(EgtDoorsMsg[407],sNamePar18,EgtToUiUnits(clc),'',EgtToUiUnits(2*(ccr*sin(45))), sCompoPath) -- il parametro 'clc' deve essere > 'crc'
clc = (2*(ccr*sin(45)))+0.2
end
if not bPreview and EC ~= 0 then
return (ErrorBase+EC), EM
end
-- Se Preview cancello tutto
if bPreview then
EgtNewFile()
EgtSetDefaultMaterial( BLACK())
end
-- Pezzo e Layer
local Pz
if bPreview then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
else
if not RC then
Pz = EgtGetCurrPart() -- pezzo corrente
end
if not Pz then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
end
end
local Lg, Dm
local sRequireCompoName
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName(Lg,sCompoName)
if nDrawMach > 0 then -- se abilitata geometria lavorazione
Dm = EgtGroup( Pz, GDB_RT.LOC) -- layer disegni cerchi rappresentante il diametro utensile
EgtSetName( Dm, DM)
end
if ls then -- se latch strike lancio il componente standard
sRequireCompoName = '_OverHeadArm'
else
sRequireCompoName = '_Latch'
tOHead.cl = cl
tOHead.invG = invG
tOHead.DY = -DY
tOHead.smr = 0
end
if bMakeFaceGeom then
-- lancio il primo componente base
MHgen = require( sRequireCompoName)
nGeom1, nPkToJoin1, nAS1, nAS2, nIdSideBoxUp = MHgen.Draw( EC, EM, tOHead, bPreview, bRunByCompo, nForceMakeFace, Pz, Lg, dThickDoor, 'OH')
-- Clean corner
if nDrawMach >= 0 then -- se abilitata geometria
local CLC1
if CLC and clc and clc > 0 and clc < H and clc < L then
CLC1 = MakeClcPath( clc, ccr, CLC, Lg, -T)
if CLC1 then
-- se mantiene lato anche su face
if kbs and kbs > 0 then
local sKeepMode = 'n' -- setto di default per mantenere il lato narrow
if bEqualTh or not ls then -- se spessore passante o in centro allo spessore
sKeepMode = 'c' -- setto per mantenere il centro dello spessore
end
EgtSetInfo( CLC1, 'KeepBackSet', sKeepMode)
end
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( CLC1, 'ProbeSide', '1')
end
EgtSetInfo( CLC1,'InserPoint' ,'Edge') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo( CLC1,'DeltaPos' ,( L+(2*DS)))
if ls then -- se latch string
if OS <= 0 then -- se cava non aperta a destra
-- angolo x+y-
local CLC2 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC2, Point3d(0,0,0), Z_AX(), 180)
EgtMove( CLC2, Point3d((L/2),-H,0) - ORIG())
-- muovo ulteriormente le geometrie
EgtMove( CLC2, Point3d(-((L/2)+DS),0,0) - ORIG())
end
if OS >= 0 then -- se cava non aperta a sinistra
-- angolo x-y-
EgtRotate( CLC1, Point3d(0,0,0), Z_AX(), 90)
EgtMove( CLC1, Point3d(-(L/2),-H,0) - ORIG())
-- muovo ulteriormente le geometrie
EgtMove( CLC1, Point3d(-((L/2)+DS),0,0) - ORIG())
else
EgtErase(CLC1)
end
else -- altrimenti non latch strike
if OS <= 0 then -- se cava non aperta a destra
-- angolo x+y+
local CLC2 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC2, Point3d(0,0,0), Z_AX(), -90)
EgtMove( CLC2, Point3d((L/2),(H/2),0) - ORIG())
-- angolo x+y-
local CLC3 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC3, Point3d(0,0,0), Z_AX(), 180)
EgtMove( CLC3, Point3d((L/2),-(H/2),0) - ORIG())
EgtMove( CLC2, Point3d(-((L/2)+DS),-(dThickDoor/2),0) - ORIG())
EgtMove( CLC3, Point3d(-((L/2)+DS),-(dThickDoor/2),0) - ORIG())
end
if OS >= 0 then -- se cava non aperta a sinistra
-- angolo x-y-
local CLC4 = EgtCopyGlob( CLC1, Lg)
EgtRotate( CLC4, Point3d(0,0,0), Z_AX(), 90)
EgtMove( CLC4, Point3d(-(L/2),-(H/2),0) - ORIG())
-- angolo x-y+
EgtMove( CLC1, Point3d(-(L/2),(H/2),0) - ORIG())
-- muovo ulteriormente le geometrie
EgtMove( CLC1, Point3d(-((L/2)+DS),-(dThickDoor/2),0) - ORIG())
EgtMove( CLC4, Point3d(-((L/2)+DS),-(dThickDoor/2),0) - ORIG())
else
EgtErase(CLC1)
end
end
end
end
end
end
if bMakeMortGeom then
tOHead.smr = 0
-- lancio il secondo componente base
MHgen = require('_OverHeadPocket')
nGeom2, nPkToJoin2 = MHgen.Draw( EC, EM, tOHead, bPreview, bRunByCompo, nDrawMach, Pz, Lg)
end
-- Se non Preview
if not bPreview and EC == 0 then
if bRunByCompo then
-- scrivo i parametri nelle info del pezzo
WriteCompoDataToPart(Pz,sCompoName,nCompoNpar)
end
-- scrivo note nel layer della geometria
EgtSetInfo(Lg,'Type' ,'OverHead')
EgtSetInfo(Lg,'L' ,L)
EgtSetInfo(Lg,'H' ,H)
EgtSetInfo(Lg,'T' ,T)
EgtSetInfo(Lg,'rf' ,rf)
EgtSetInfo(Lg,'d' ,d)
EgtSetInfo(Lg,'p' ,p)
EgtSetInfo(Lg,'sf' ,sf)
EgtSetInfo(Lg,'d2' ,d2)
EgtSetInfo(Lg,'DS' ,DS)
EgtSetInfo(Lg,'OS' ,OS)
EgtSetInfo(Lg,'ech' ,ech)
EgtSetInfo(Lg,'ls' ,ls)
EgtSetInfo(Lg,'bEqualTh' ,bEqualTh)
EgtSetInfo(Lg,'DY' ,DY)
EgtSetInfo(Lg,'L2' ,L2)
EgtSetInfo(Lg,'H2' ,H2)
EgtSetInfo(Lg,'T2' ,T2)
EgtSetInfo(Lg,'d3' ,d3)
EgtSetInfo(Lg,'p3' ,p3)
EgtSetInfo(Lg,'s' ,s)
EgtSetInfo(Lg,'est' ,est)
EgtSetInfo(Lg,'kbs' ,kbs)
EgtSetInfo(Lg,'pbs' ,pbs)
EgtSetInfo(Lg,'DS2' ,DS2)
EgtSetInfo(Lg,'fht' ,fht)
EgtSetInfo(Lg,'fhb' ,fhb)
EgtSetInfo(Lg,'LG' ,LG)
EgtSetInfo(Lg,'LM' ,LM)
EgtSetInfo(Lg,'LA' ,LA)
EgtSetInfo(Lg,'LGM' ,LGM)
EgtSetInfo(Lg,'LMM' ,LMM)
EgtSetInfo(Lg,'CH' ,CH)
EgtSetInfo(Lg,'Path' ,sCompoPath)
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase( Dm)
end
elseif not bPreview then
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase( Dm)
end
end
if EC == 0 and nCodAdj and nCodAdj < 0 then
EC = nCodAdj
EM = sCodAdj
end
return EC, EM, Lg
end
return OverHead
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3024
View File
File diff suppressed because it is too large Load Diff
+1376
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3746
View File
File diff suppressed because it is too large Load Diff
+720
View File
@@ -0,0 +1,720 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- Viewer.lua by EgalWare s.r.l. 2016.07.05
-- Autore: Filippo Monchi
-- Spioncino
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2020.04.29 V2.001 FM Update for aluminum material
-- 2021.11.24 V2.002 FM Manage side probe option if variable DGC.Pms > 2
-- 2022.07.20 V2.003 FM Use parameter .ITP (Internal Path) from template lua file instead of function EgtGetSourceDir(1)
-- 2022.07.27 V2.004 FM Modification to use compiled code
-- Tavola per definizione modulo (serve ma non usata)
local Viewer = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Funzione di sistemazione parametri
function Viewer.AdjustParams( tMhPar)
-- se porta steel o aluminum
if FindMaterial( DGD.Material, 'steel') or FindMaterial( DGD.Material, 'aluminum') then
tMhPar.est = true
else
tMhPar.est = nil
end
if tMhPar.T1 then
if tMhPar.T1 == -0.5 then
tMhPar.T1 = DGD.dT / 2
elseif tMhPar.T1 == -1 then
tMhPar.T1 = DGD.dT
end
end
if tMhPar.T2 then
if tMhPar.T2 == -0.5 then
tMhPar.T2 = DGD.dT / 2
elseif tMhPar.T2 == -1 then
tMhPar.T2 = DGD.dT
end
end
if tMhPar.T3 then
if tMhPar.T3 == -0.5 then
tMhPar.T3 = DGD.dT / 2
elseif tMhPar.T3 == -1 then
tMhPar.T3 = DGD.dT
end
end
if tMhPar.T4 then
if tMhPar.T4 == -0.5 then
tMhPar.T4 = DGD.dT / 2
elseif tMhPar.T4 == -1 then
tMhPar.T4 = DGD.dT
end
end
-- extra bores
if tMhPar.T10 then
if tMhPar.T10 == -0.5 then
tMhPar.T10 = DGD.dT / 2
elseif tMhPar.T10 == -1 or tMhPar.T10 > DGD.dT then
tMhPar.T10 = DGD.dT
end
end
if tMhPar.T11 then
if tMhPar.T11 == -0.5 then
tMhPar.T11 = DGD.dT / 2
elseif tMhPar.T11 == -1 or tMhPar.T11 > DGD.dT then
tMhPar.T11 = DGD.dT
end
end
if tMhPar.T12 then
if tMhPar.T12 == -0.5 then
tMhPar.T12 = DGD.dT / 2
elseif tMhPar.T12 == -1 or tMhPar.T12 > DGD.dT then
tMhPar.T12 = DGD.dT
end
end
if tMhPar.T13 then
if tMhPar.T13 == -0.5 then
tMhPar.T13 = DGD.dT / 2
elseif tMhPar.T13 == -1 or tMhPar.T13 > DGD.dT then
tMhPar.T13 = DGD.dT
end
end
if tMhPar.T14 then
if tMhPar.T14 == -0.5 then
tMhPar.T14 = DGD.dT / 2
elseif tMhPar.T14 == -1 or tMhPar.T14 > DGD.dT then
tMhPar.T14 = DGD.dT
end
end
if tMhPar.T15 then
if tMhPar.T15 == -0.5 then
tMhPar.T15 = DGD.dT / 2
elseif tMhPar.T15 == -1 or tMhPar.T15 > DGD.dT then
tMhPar.T15 = DGD.dT
end
end
if tMhPar.T16 then
if tMhPar.T16 == -0.5 then
tMhPar.T16 = DGD.dT / 2
elseif tMhPar.T16 == -1 or tMhPar.T16 > DGD.dT then
tMhPar.T16 = DGD.dT
end
end
if tMhPar.T17 then
if tMhPar.T17 == -0.5 then
tMhPar.T17 = DGD.dT / 2
elseif tMhPar.T17 == -1 or tMhPar.T17 > DGD.dT then
tMhPar.T17 = DGD.dT
end
end
if tMhPar.T18 then
if tMhPar.T18 == -0.5 then
tMhPar.T18 = DGD.dT / 2
elseif tMhPar.T18 == -1 or tMhPar.T18 > DGD.dT then
tMhPar.T18 = DGD.dT
end
end
if tMhPar.T19 then
if tMhPar.T19 == -0.5 then
tMhPar.T19 = DGD.dT / 2
elseif tMhPar.T19 == -1 or tMhPar.T19 > DGD.dT then
tMhPar.T19 = DGD.dT
end
end
if tMhPar.T20 then
if tMhPar.T20 == -0.5 then
tMhPar.T20 = DGD.dT / 2
elseif tMhPar.T20 == -1 or tMhPar.T20 > DGD.dT then
tMhPar.T20 = DGD.dT
end
end
if tMhPar.T21 then
if tMhPar.T21 == -0.5 then
tMhPar.T21 = DGD.dT / 2
elseif tMhPar.T21 == -1 or tMhPar.T21 > DGD.dT then
tMhPar.T21 = DGD.dT
end
end
if tMhPar.T22 then
if tMhPar.T22 == -0.5 then
tMhPar.T22 = DGD.dT / 2
elseif tMhPar.T22 == -1 or tMhPar.T22 > DGD.dT then
tMhPar.T22 = DGD.dT
end
end
if tMhPar.T23 then
if tMhPar.T23 == -0.5 then
tMhPar.T23 = DGD.dT / 2
elseif tMhPar.T23 == -1 or tMhPar.T23 > DGD.dT then
tMhPar.T23 = DGD.dT
end
end
if tMhPar.T24 then
if tMhPar.T24 == -0.5 then
tMhPar.T24 = DGD.dT / 2
elseif tMhPar.T24 == -1 or tMhPar.T24 > DGD.dT then
tMhPar.T24 = DGD.dT
end
end
if tMhPar.T25 then
if tMhPar.T25 == -0.5 then
tMhPar.T25 = DGD.dT / 2
elseif tMhPar.T25 == -1 or tMhPar.T25 > DGD.dT then
tMhPar.T25 = DGD.dT
end
end
if tMhPar.T26 then
if tMhPar.T26 == -0.5 then
tMhPar.T26 = DGD.dT / 2
elseif tMhPar.T26 == -1 or tMhPar.T26 > DGD.dT then
tMhPar.T26 = DGD.dT
end
end
if tMhPar.T27 then
if tMhPar.T27 == -0.5 then
tMhPar.T27 = DGD.dT / 2
elseif tMhPar.T27 == -1 or tMhPar.T27 > DGD.dT then
tMhPar.T27 = DGD.dT
end
end
if tMhPar.T28 then
if tMhPar.T28 == -0.5 then
tMhPar.T28 = DGD.dT / 2
elseif tMhPar.T28 == -1 or tMhPar.T28 > DGD.dT then
tMhPar.T28 = DGD.dT
end
end
if tMhPar.T29 then
if tMhPar.T29 == -0.5 then
tMhPar.T29 = DGD.dT / 2
elseif tMhPar.T29 == -1 or tMhPar.T29 > DGD.dT then
tMhPar.T29 = DGD.dT
end
end
-- percorso custom nge
if tMhPar.CGF and tMhPar.CGP then
if string.len(tMhPar.CGF) > 0 and string.len(tMhPar.CGP) == 0 then
tMhPar.CGP = tMhPar.ITP
end
end
return tMhPar
end
-- Funzione di disegno
function Viewer.Draw( tViwr, bPreview, bRunByCompo, nDrawMach)
local est = tViwr.est
-- Nome file custom geometry e percorso file da caricare
local CustGeomFile = tViwr.CGF or ''
local CustGeomPath = tViwr.CGP or ''
-- tabelle per i fori, rettangoli e linee opzionali
local tExtraBore = {}
-- Assegno le dimensioni geometrie KEYWAY
local D1 = tViwr.D1
local T1 = tViwr.T1
local ms = tViwr.ms
local D2 = tViwr.D2
local T2 = tViwr.T2
local I2 = tViwr.I2
local AV = tViwr.AV
local mc = tViwr.mc
-- inserimento dati nella tabella fori Keyway
table.insert( tExtraBore, { tViwr.D10, tViwr.T10, tViwr.PX10, tViwr.PY10, tViwr.EB10})
table.insert( tExtraBore, { tViwr.D11, tViwr.T11, tViwr.PX11, tViwr.PY11, tViwr.EB11})
table.insert( tExtraBore, { tViwr.D12, tViwr.T12, tViwr.PX12, tViwr.PY12, tViwr.EB12})
table.insert( tExtraBore, { tViwr.D13, tViwr.T13, tViwr.PX13, tViwr.PY13, tViwr.EB13})
table.insert( tExtraBore, { tViwr.D14, tViwr.T14, tViwr.PX14, tViwr.PY14, tViwr.EB14})
table.insert( tExtraBore, { tViwr.D15, tViwr.T15, tViwr.PX15, tViwr.PY15, tViwr.EB15})
table.insert( tExtraBore, { tViwr.D16, tViwr.T16, tViwr.PX16, tViwr.PY16, tViwr.EB16})
table.insert( tExtraBore, { tViwr.D17, tViwr.T17, tViwr.PX17, tViwr.PY17, tViwr.EB17})
table.insert( tExtraBore, { tViwr.D18, tViwr.T18, tViwr.PX18, tViwr.PY18, tViwr.EB18})
table.insert( tExtraBore, { tViwr.D19, tViwr.T19, tViwr.PX19, tViwr.PY19, tViwr.EB19})
-- Assegno le dimensioni geometrie SECURE
local D3 = tViwr.D3
local T3 = tViwr.T3
local msd = tViwr.msd
local D4 = tViwr.D4
local T4 = tViwr.T4
local I4 = tViwr.I4
local AVd = tViwr.AVd
local mcd = tViwr.mcd
-- inserimento dati nella tabella fori Secure
table.insert( tExtraBore, { tViwr.D20, tViwr.T20, tViwr.PX20, tViwr.PY20, tViwr.EB20})
table.insert( tExtraBore, { tViwr.D21, tViwr.T21, tViwr.PX21, tViwr.PY21, tViwr.EB21})
table.insert( tExtraBore, { tViwr.D22, tViwr.T22, tViwr.PX22, tViwr.PY22, tViwr.EB22})
table.insert( tExtraBore, { tViwr.D23, tViwr.T23, tViwr.PX23, tViwr.PY23, tViwr.EB23})
table.insert( tExtraBore, { tViwr.D24, tViwr.T24, tViwr.PX24, tViwr.PY24, tViwr.EB24})
table.insert( tExtraBore, { tViwr.D25, tViwr.T25, tViwr.PX25, tViwr.PY25, tViwr.EB25})
table.insert( tExtraBore, { tViwr.D26, tViwr.T26, tViwr.PX26, tViwr.PY26, tViwr.EB26})
table.insert( tExtraBore, { tViwr.D27, tViwr.T27, tViwr.PX27, tViwr.PY27, tViwr.EB27})
table.insert( tExtraBore, { tViwr.D28, tViwr.T28, tViwr.PX28, tViwr.PY28, tViwr.EB28})
table.insert( tExtraBore, { tViwr.D29, tViwr.T29, tViwr.PX29, tViwr.PY29, tViwr.EB29})
-- Assegno le label degli attributi porta KEYWAY
local LSU = tViwr.LSU
local SCU = tViwr.SCU
-- Assegno le label degli attributi porta SECURE
local LSD = tViwr.LSD
local SCD = tViwr.SCD
-- variabili per messaggi e settaggi vari
local sCompoName = tViwr.Nome
local nCompoNpar = tViwr.Npar
local sCompoPath = tViwr.Path
-- variabili per messaggi di errore
local sNamePar6 = tViwr.NPI2 or 'I2'
local sNamePar7 = tViwr.NPAV or 'Screw direction on KEYWAY side'
local sNamePar14 = tViwr.NPI4 or 'I4'
local sNamePar15 = tViwr.NPAVd or 'Screw direction on SECURE side'
-- RunByComponetInterface
local RC = true
-- Messaggi codice errori
local EM = ' '
local EC = 0
local ErrorBase = 1400
if not bRunByCompo then
RC = false
end
-- se non definita o parametri relativi alla definizione dei percorsi sono mancanti, la setto per non creare geometria di lavorazione
if not nDrawMach then
nDrawMach = 0
end
local EgtDoorsMsg = require( 'EgtDoorsMsg')
-- Verifica delle dimensioni, alcune condizioni vengono verificate solo se è abilitata la creazione dei percorsi di lavorazione
if ms and AV and ( AV < 0 or AV > 180) then
EC = 1
EM = string.format(EgtDoorsMsg[403],sNamePar7,AV,0,180, sCompoPath) -- il parametro 'AV' deve essere compreso tra
AV = 90
elseif msd and AVd and ( AVd < 0 or AVd > 180) then
EC = 2
EM = string.format(EgtDoorsMsg[403],sNamePar15,AVd,0,180, sCompoPath) -- il parametro 'AVd' deve essere compreso tra
AVd = 90
elseif ms and I2 and D1 and I2 <= D1 then -- se fori vite abilitati e interasse fori < diametro foro maniglia
EC = 3
EM = string.format(EgtDoorsMsg[420],sNamePar6,EgtToUiUnits(I2),EgtToUiUnits(D1), sCompoPath) -- il parametro interasse fori deve essere > del diametro foro spioncino
I2 = D1 + 10
elseif msd and D3 and I4 and I4 <= D3 then -- se fori vite abilitati e interasse fori < diametro foro maniglia
EC = 4
EM = string.format(EgtDoorsMsg[420],sNamePar33,EgtToUiUnits(I8),EgtToUiUnits(D7), sCompoPath) -- il parametro interasse fori deve essere > del diametro foro maniglia
I4 = D3 + 10
end
if not bPreview and EC ~= 0 then
return (ErrorBase+EC), EM
end
-- Se Preview cancello tutto
if bPreview then
EgtNewFile()
EgtSetDefaultMaterial( BLACK())
end
-- Pezzo e Layer
local Pz
if bPreview then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
else
if not RC then
Pz = EgtGetCurrPart() -- pezzo corrente
end
if not Pz then
Pz = EgtGroup(GDB_ID.ROOT,GDB_RT.LOC) -- nuovo pezzo
end
end
local Lg
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer principale
EgtSetName(Lg,sCompoName)
local hint1, hint2, hint3, hint4, hint5 -- variabili entità geometriche
local hint, hint_2, hint_3 -- variabili percorsi
-- Gestione file custom
local MakeFaceGeom = true
-- caricamento del file custom
if string.len(CustGeomFile) > 0 and string.find( string.lower(CustGeomFile), '.nge') > 0 then
-- sostituisco il carattere '\' con '_' nel nome file
CustGeomFile = string.gsub(CustGeomFile, '\\', '_')
CustGeomFile = string.gsub(CustGeomFile, '/', '_')
-- concateno il file alla path
local sCustomPathFile = CustGeomPath..CustGeomFile
local nNewPart
local nNewLayer
local nNewEnt
local nTypeEnt
local sTypeInfo
local cColor
-- provo ad inserire
MakeFaceGeom = not EgtInsertFile( sCustomPathFile)
-- se fallito inserimento file dò un messaggio di errore
if MakeFaceGeom then
EC = ErrorBase + 10
EM = string.format( EgtDoorsMsg[457], sCustomPathFile)
else
nNewPart = EgtGetNext(Pz) -- nome nuovo pezzo
nNewLayer = EgtGetFirstInGroup( nNewPart) -- ottengo nuovo layer
-- riloco tutti i nuovi layer dal nuovo pezzo al pezzo corrente
while nNewLayer do
nNewEnt = EgtGetFirstInGroup( nNewLayer) -- ottengo nuova entità
while nNewEnt do
-- controllo se è un cerchio e se ha dei colori e le note giuste per cambiare lo spessore
nTypeEnt = EgtGetType( nNewEnt)
sTypeInfo = EgtGetInfo( nNewEnt, 'SideDoor')
cColor = EgtGetCalcColor( nNewEnt)
if sTypeInfo and cColor and DGD.dT then
if string.lower(sTypeInfo) == 'keyway' or string.lower(sTypeInfo) == 'secure' then
if AreSameColor(cColor,RED(),30) then -- se colore rosso allora spessore completo
EgtModifyCurveThickness(nNewEnt, -DGD.dT)
elseif AreSameColor(cColor,LIME(),30) then -- se colore verde allora metà spessore
EgtModifyCurveThickness(nNewEnt, -(DGD.dT/2))
-- se mantiene profondità e non è a spessore passante
if kbs and kbs > 1 then
EgtSetInfo( nNewEnt, 'KeepBackSet', 'x') -- setto 'x' provvisoriamente
end
if pbs and pbs > 1 then
if DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( nNewEnt, 'ProbeSide', '1')
end
end
else -- altrimenti controllo che lo spessore non supera quello della porta, se lo supera lo setto = spessore porta
local dTh = EgtCurveThickness( nNewEnt)
if abs(dTh) > DGD.dT then
EgtModifyCurveThickness( nNewEnt, EgtIf( dTh > 0, DGD.dT, -DGD.dT))
elseif abs(dTh) < DGD.dT then
-- se mantiene profondità e non è a spessore passante
if kbs and kbs > 1 then
EgtSetInfo( nNewEnt, 'KeepBackSet', 'x') -- setto 'x' provvisoriamente
end
if pbs and pbs > 1 then
if DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( nNewEnt, 'ProbeSide', '1')
end
end
end
end
end
elseif sTypeInfo and string.lower(sTypeInfo) == 'keyway' or string.lower(sTypeInfo) == 'secure' then
-- controllo che lo spessore non supera quello della porta, se lo supera lo setto = spessore porta
local dTh = EgtCurveThickness( nNewEnt)
if abs(dTh) > DGD.dT then
EgtModifyCurveThickness( nNewEnt, EgtIf( dTh > 0, DGD.dT, -DGD.dT))
elseif abs(dTh) < DGD.dT then
-- se mantiene profondità e non è a spessore passante
if kbs and kbs > 1 then
EgtSetInfo( nNewEnt, 'KeepBackSet', 'x') -- setto 'x' provvisoriamente
end
if pbs and pbs > 1 then
if DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( nNewEnt, 'ProbeSide', '1')
end
end
end
end
EgtRelocateGlob( nNewEnt, Lg) -- riloco nel layer della serratura
nNewEnt = EgtGetFirstInGroup(nNewLayer)
end
nNewLayer = EgtGetNext(nNewLayer)
end
-- cancello il nuovo pezzo
EgtErase(nNewPart)
end
end
-- Costruzione della geometria KEYWAY
-- se dimensioni foro spioncino idonee
if D1 and T1 and LSU then
if D1 > 0 and T1 ~= 0 then
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
hint_1 = EgtCircle( Lg, Point3d(0,0,0), D1/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_1, -T1)
EgtSetName(hint_1,LSU)
EgtSetInfo(hint_1,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
end
end
if ms then -- se devo fare le viti Keyway
if D2 and T2 and SCU then
-- se dimensioni foro vite idonee
if D2 > 0 and T2 ~= 0 then
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
if not I2 then
I2 = D1
end
hint_2 = EgtCircle( Lg, Point3d(-((I2/2) * sin(AV)),((I2/2) * cos(AV)),0), D2/2 , GDB_RT.LOC)
hint_3 = EgtCircle( Lg, Point3d(((I2/2) * sin(AV)),-((I2/2) * cos(AV)),0), D2/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_2, -T2)
EgtModifyCurveThickness(hint_3, -T2)
EgtSetName(hint_2,SCU)
EgtSetName(hint_3,SCU)
EgtSetInfo(hint_2,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo(hint_3,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
if mc then -- se fori vite a croce
hint_2 = EgtCircle( Lg, Point3d(-((I2/2) * sin(AV+90)),((I2/2) * cos(AV+90)),0), D2/2 , GDB_RT.LOC)
hint_3 = EgtCircle( Lg, Point3d(((I2/2) * sin(AV+90)),-((I2/2) * cos(AV+90)),0), D2/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_2, -T2)
EgtModifyCurveThickness(hint_3, -T2)
EgtSetName(hint_2,SCU)
EgtSetName(hint_3,SCU)
EgtSetInfo(hint_2,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo(hint_3,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
end
end
end
end
-- Extra bores Keyway
for k = 1, 10 do
local D10 = tExtraBore[k][1]
local T10 = tExtraBore[k][2]
local PX10 = tExtraBore[k][3]
local PY10 = tExtraBore[k][4]
local EB10 = tExtraBore[k][5]
-- se dimensioni foro serratura idonee
if D10 and T10 and EB10 then
if D10 > 0 and T10 ~= 0 and EB10 ~= '' then
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
if not PX10 then
PX10 = 0
end
if not PY10 then
PY10 = 0
end
hint_3 = EgtCircle( Lg, Point3d(PX10,PY10,0), D10/2, GDB_RT.LOC)
EgtModifyCurveThickness(hint_3, -T10)
EgtSetName(hint_3,EB10)
EgtSetInfo(hint_3,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
end
end
end
-- Costruzione della geometria lato Secure
-- se dimensioni foro spioncino idonee
if D3 and T3 and LSD then
if D3 > 0 and T3 ~= 0 then
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
hint_1 = EgtCircle( Lg, Point3d(0,0,0), D3/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_1, -T3)
EgtSetName(hint_1,LSD)
EgtSetInfo(hint_1,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
end
end
if msd then -- se devo fare le viti
-- se dimensioni foro vite idonee
if D4 and T4 and SCD then
if D4 > 0 and T4 ~= 0 then
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer del foro serraura SECURE
EgtSetName(Lg,sCompoName)
end
if not I4 then
I4 = D3
end
hint_2 = EgtCircle( Lg, Point3d(-((I4/2) * sin(AVd)),((I4/2) * cos(AVd)),0), D4/2 , GDB_RT.LOC)
hint_3 = EgtCircle( Lg, Point3d(((I4/2) * sin(AVd)),-((I4/2) * cos(AVd)),0), D4/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_2, -T4)
EgtModifyCurveThickness(hint_3, -T4)
EgtSetName(hint_2,SCD)
EgtSetName(hint_3,SCD)
EgtSetInfo(hint_2,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo(hint_3,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
if mcd then -- se fori vite a croce
hint_2 = EgtCircle( Lg, Point3d(-((I4/2) * sin(AVd+90)),((I4/2) * cos(AVd-90)),0), D4/2 , GDB_RT.LOC)
hint_3 = EgtCircle( Lg, Point3d(((I4/2) * sin(AVd+90)),-((I4/2) * cos(AVd-90)),0), D4/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_2, -T4)
EgtModifyCurveThickness(hint_3, -T4)
EgtSetName(hint_2,SCD)
EgtSetName(hint_3,SCD)
EgtSetInfo(hint_2,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo(hint_3,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
end
end
end
end
-- Extra bores Secure
for k = 11, 20 do
local D10 = tExtraBore[k][1]
local T10 = tExtraBore[k][2]
local PX10 = tExtraBore[k][3]
local PY10 = tExtraBore[k][4]
local EB10 = tExtraBore[k][5]
-- se dimensioni foro serratura idonee
if D10 and T10 and EB10 then
if D10 > 0 and T10 ~= 0 and EB10 ~= '' then
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
if not PX10 then
PX10 = 0
end
if not PY10 then
PY10 = 0
end
hint_3 = EgtCircle( Lg, Point3d(PX10,-PY10,0), D10/2 , GDB_RT.LOC)
EgtModifyCurveThickness(hint_3, -T10)
EgtSetName(hint_3,EB10)
EgtSetInfo(hint_3,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
end
end
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if Lg then
EgtSetColor(Lg,AQUA())
end
else
if Lg then
EgtSetColor(Lg,ORANGE())
end
end
else -- altrimenti non Preview
-- (NOTA : se ci sono errori il componente non viene eseguito dal programma di gestione dei componenti)
if bRunByCompo then
-- scrivo i parametri nelle info del pezzo
WriteCompoDataToPart(Pz,sCompoName,nCompoNpar)
end
-- scrivo note nel layer della cerniera
EgtSetInfo(Lg,'Type' ,'Viewer')
EgtSetInfo(Lg,'Nome' ,sCompoName)
EgtSetInfo(Lg,'D1' ,D1)
EgtSetInfo(Lg,'T1' ,T1)
EgtSetInfo(Lg,'ms' ,ms)
EgtSetInfo(Lg,'D2' ,D2)
EgtSetInfo(Lg,'T2' ,T2)
EgtSetInfo(Lg,'I2' ,I2)
EgtSetInfo(Lg,'AV' ,AV)
EgtSetInfo(Lg,'mc' ,mc)
EgtSetInfo(Lg,'D3' ,D3)
EgtSetInfo(Lg,'T3' ,T3)
EgtSetInfo(Lg,'msd' ,msd)
EgtSetInfo(Lg,'D4' ,D4)
EgtSetInfo(Lg,'T4' ,T4)
EgtSetInfo(Lg,'I4' ,I4)
EgtSetInfo(Lg,'AVd' ,AVd)
EgtSetInfo(Lg,'mcd' ,mcd)
EgtSetInfo(Lg,'est' ,est)
EgtSetInfo(Lg,'CustGeomFile' ,CustGeomFile)
EgtSetInfo(Lg,'CustGeomPath' ,CustGeomPath)
EgtSetInfo(Lg,'LSU' ,LSU)
EgtSetInfo(Lg,'SCU' ,SCU)
EgtSetInfo(Lg,'LSD' ,LSD)
EgtSetInfo(Lg,'SCD' ,SCD)
EgtSetInfo(Lg,'Path' ,sCompoPath)
end
return EC, EM, Lg
end
return Viewer
File diff suppressed because it is too large Load Diff
+483
View File
@@ -0,0 +1,483 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- AssemblyDisp.lua by EgalWare s.r.l. 2017.11.14
-- disposizione assemblato a raggruppamento
-- Tavola per definizione modulo (serve ma non usata)
local AssemblyDisp = {}
EgtEnableDebug( false)
-----------------------------------------------------------------
local function GetFromPos( nIdPiece)
local pPosPlaced = EgtGetInfo( nIdPiece, 'MoveedTo', 'p')
return pPosPlaced
end
-----------------------------------------------------------------
local function GetPosToMove( nIdPiece)
local pPosFrom = EgtGetInfo( nIdPiece, 'PosFromDoor', 'p')
return pPosFrom
end
-----------------------------------------------------------------
local function GetTypePiece( nIdPiece)
local nTypePiece = EgtGetInfo( nIdPiece, 'Piece Type', 'i')
local sAssembType = EgtGetInfo( nIdPiece, 'Assembly', 's') or ''
-- se non trovate note esco con errore
if not ( nTypePiece and sAssembType) then
return
end
-- comparo i valori per trovare corrispondenza certa
if nTypePiece == 1 and sAssembType == 'first' then
return nTypePiece
elseif nTypePiece == 2 and sAssembType == 'second' then
return nTypePiece
elseif nTypePiece == 3 and sAssembType == 'framesx' then
return nTypePiece
elseif nTypePiece == 4 and sAssembType == 'framedx' then
return nTypePiece
elseif nTypePiece == 5 and sAssembType == 'frametop' then
return nTypePiece
elseif nTypePiece == 6 and sAssembType == 'framebot' then
return nTypePiece
else
return
end
end
-----------------------------------------------------------------
local function MovePieceOfAssemb( Pz, nPrevDisp, nDispose, dExtraMove, dSecondDoorGap)
local bTypePiece = GetTypePiece( Pz)
local pPosAct = GetFromPos( Pz)
local pPosToMove = GetPosToMove( Pz)
local pCalcPos
-- se manca qualche dato non faccio nulla
if not ( bTypePiece and pPosAct and pPosToMove) then
return
end
-- se le disposizioni sono uguali non faccio nulla
if nPrevDisp == nDispose then
return
end
if nDispose == 0 then -- se devo disporre come presentato dal Door
if bTypePiece == 2 then -- se porta secondaria
if nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( dSecondDoorGap,0,0)
end
-- movimento
EgtMove( Pz, pPosAct - pCalcPos, GDB_RT.GRID)
-- assegno nota disposizione
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
else
if bTypePiece == 3 then -- se frame sx
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'T', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'H', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d(-dExtraMove,0,0)
end
-- porto il pezzo a zero
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
-- riporto il pezzo nella posizione originaria
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.FRONT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia frontale
EgtMove( Pz, Point3d(dThickPiece,0,0) - ORIG(), GDB_RT.GRID)
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
-- muovo a posizione disposta
EgtMove( Pz, pPosAct - ORIG(), GDB_RT.GRID)
-- assegno nota disposta
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 4 then -- se frame dx
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'T', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'H', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( ( dExtraMove + dSecondDoorGap),0,0)
end
-- porto il pezzo a zero
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
-- riporto il pezzo nella posizione originaria
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.FRONT))
EgtRotate( Pz, Point3d(dWidthPiece,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia frontale
EgtMove( Pz, Point3d(-dWidthPiece,0,0) - ORIG(), GDB_RT.GRID)
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
-- muovo a posizione disposta
EgtMove( Pz, pPosAct - ORIG(), GDB_RT.GRID)
-- assegno nota disposta
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 5 then -- se frame top
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'H', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'T', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( (dSecondDoorGap/2), dExtraMove,0)
end
-- porto il pezzo a zero
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
-- riporto il pezzo nella posizione originaria
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
EgtRotate( Pz, Point3d(-dLengthPiece,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia sinistra
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
EgtMove( Pz, Point3d(0,-dLengthPiece,0) - ORIG(), GDB_RT.GRID)
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia sinistra
EgtMove( Pz, Point3d(dThickPiece,0,0) - ORIG(), GDB_RT.GRID)
-- muovo a posizione disposta
EgtMove( Pz, pPosAct - ORIG(), GDB_RT.GRID)
-- assegno nota disposta
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 6 then -- se frame bottom
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'H', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'T', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( (dSecondDoorGap/2), -dExtraMove,0)
end
-- porto il pezzo a zero
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
-- riporto il pezzo nella posizione originaria
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia sinistra
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia sinistra
-- muovo a posizione disposta
EgtMove( Pz, pPosAct - ORIG(), GDB_RT.GRID)
-- assegno nota disposta
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
end
end
elseif nDispose == 1 then -- se devo disporre raggruppato
if bTypePiece == 2 then -- se porta secondaria
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( dSecondDoorGap,0,0)
end
EgtMove( Pz, pPosToMove - pCalcPos, GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
else
if bTypePiece == 3 then -- se frame sx
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'T', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'H', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, Point3d( -dThickPiece,0,0) - pCalcPos, GDB_RT.GRID)
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.FRONT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia frontale
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d(-dExtraMove,0,0)
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, pPosToMove - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 4 then -- se frame dx
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'T', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'H', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, Point3d( dWidthPiece,0,0) - pCalcPos, GDB_RT.GRID)
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.FRONT))
EgtRotate( Pz, Point3d( dWidthPiece,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia frontale
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( ( dExtraMove + dSecondDoorGap),0,0)
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, pPosToMove - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 5 then -- se frame top
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'H', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'T', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, Point3d( -dThickPiece,0,0) - pCalcPos, GDB_RT.GRID)
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia top
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia left
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
EgtMove( Pz, Point3d(0,dLengthPiece,0) - ORIG(), GDB_RT.GRID)
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( (dSecondDoorGap/2), dExtraMove,0)
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, pPosToMove - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 6 then -- se frame bottom
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'H', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'T', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia top
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia left
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
elseif nPrevDisp == 2 then -- se disposizione attuale esplosa
pCalcPos = pPosToMove + Vector3d( (dSecondDoorGap/2), -dExtraMove,0)
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, pPosToMove - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
end
end
elseif nDispose == 2 then -- se devo disporre esploso
if bTypePiece == 2 then -- se porta secondaria
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
elseif nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
end
EgtMove( Pz, ( pPosToMove + Vector3d( dSecondDoorGap,0,0)) - pCalcPos, GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
else
if bTypePiece == 3 then -- se frame sx
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'T', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'H', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, Point3d( -dThickPiece,0,0) - pCalcPos, GDB_RT.GRID)
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.FRONT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia frontale
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
elseif nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, ( pPosToMove + Vector3d( -dExtraMove,0,0)) - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 4 then -- se frame dx
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'T', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'H', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, Point3d( dWidthPiece,0,0) - pCalcPos, GDB_RT.GRID)
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.FRONT))
EgtRotate( Pz, Point3d( dWidthPiece,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia frontale
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
elseif nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, ( pPosToMove + Vector3d( ( dExtraMove + dSecondDoorGap),0,0)) - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 5 then -- se frame top
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'H', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'T', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, Point3d( -dThickPiece,0,0) - pCalcPos, GDB_RT.GRID)
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia top
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia left
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
EgtMove( Pz, Point3d(0,dLengthPiece,0) - ORIG(), GDB_RT.GRID)
elseif nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, ( pPosToMove + Vector3d( (dSecondDoorGap/2), dExtraMove,0)) - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
elseif bTypePiece == 6 then -- se frame bottom
-- acquisisco le misure del pezzo relative al tipo di pezzo
local dWidthPiece = EgtGetInfo( Pz, 'H', 'd')
local dLengthPiece = EgtGetInfo( Pz, 'T', 'd')
local dThickPiece = EgtGetInfo( Pz, 'W', 'd')
if nPrevDisp == 0 then -- se disposizione attuale disposta come door
pCalcPos = pPosAct
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), -90, GDB_RT.GRID) -- ruoto su faccia top
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
EgtRotate( Pz, Point3d(0,0,0), Z_AX(), 90, GDB_RT.GRID) -- ruoto su faccia left
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
elseif nPrevDisp == 1 then -- se disposizione attuale raggruppata
pCalcPos = pPosToMove
-- prima devo portare il pezzo a zero e ruotarlo come originale
EgtMove( Pz, ORIG() - pCalcPos, GDB_RT.GRID)
end
-- movimento a nuova posizione
EgtMove( Pz, ( pPosToMove + Vector3d( (dSecondDoorGap/2), -dExtraMove,0)) - ORIG(), GDB_RT.GRID)
-- assegno nota raggruppata
EgtSetInfo( Pz, 'DisposeAssembly', nDispose)
end
end
end
end
-----------------------------------------------------------------
function AssemblyDisp.AssemblyDispose( nDisposeMain)
-- ciclo per leggere i pezzi
local dExtraMove = 100
local dSecondDoorGap = 0
local Pz = EgtGetFirstPart()
while Pz do
local bTypePiece = GetTypePiece( Pz)
if bTypePiece and bTypePiece == 2 then
dSecondDoorGap = dExtraMove / 2
Pz = nil
else
-- passo al pezzo successivo
Pz = EgtGetNextPart( Pz)
end
end
Pz = EgtGetFirstPart()
local nDispose
while Pz do
local nPrevDisp = EgtGetInfo( Pz, 'DisposeAssembly', 'i')
if nPrevDisp == nil then
nDispose = 1
nPrevDisp = 0
elseif nPrevDisp == 0 then
nDispose = 1
elseif nPrevDisp == 1 then
nDispose = 2
elseif nPrevDisp == 2 then
nDispose = 0
end
-- se il flag passato dal main non è nil prendo questo valore
if nDisposeMain ~= nil then nDispose = nDisposeMain end
-- muovo il pezzo
MovePieceOfAssemb( Pz, nPrevDisp, nDispose, dExtraMove, dSecondDoorGap)
-- passo al pezzo successivo
Pz = EgtGetNextPart( Pz)
end
return true
end
return AssemblyDisp
+908
View File
@@ -0,0 +1,908 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- _Latch.lua by EgalWare s.r.l. 2016.06.14
-- Autore: Filippo Monchi
-- Latch, componente di secondo livello, non può essere chiamato direttamente da un lua dei
-- componenti di interfaccia
-- 2019.10.15 V1.002 FM Manage steel option
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2020.01.08 V2.001 FM Manage start point on shortest side with steel material
-- 2020.05.25 V2.002 FM Manage geometries for calculate region when frame(jamb) is disposed on wide side
-- 2021.10.15 V2.003 FM Fix error on calculate lead out line when length or width is smaller than leadout line
-- 2021.11.24 V2.004 FM Manage side probe option if variable DGC.Pms > 2
-- 2024.07.19 V2.005 FM Set note 'NotCheckDir' to pocketing path
-- Tavola per definizione modulo (serve ma non usata)
local _Latch = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
local sMaxFeed = 'MaxFeed'
local sRapid = 'Rapid'
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
local nNumLine
if idTable then
table.insert( idTable, nLine)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumLine = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor(nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor(nCircle2, cColor2)
end
end
return nLine, nNumLine, sMVar
end
local function DrawAddCircleDrawCircle( pCenter, dRadius, dAngIni, dAngCen, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar)
local nCircle = EgtArc( nGroup, pCenter, dRadius, dAngIni, dAngCen, 0, GDB_RT.LOC)
local nNumCircle
if idTable then
table.insert( idTable, nCircle)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumCircle = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, EgtSP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, EgtEP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle2, cColor2)
end
end
return nCircle, nNumCircle, sMVar
end
-- Funzione di disegno
function _Latch.Draw( EC, EM, tLatchParam, bPreview, bRunByCompo, nDrawMach, Pz, Lg, dThickDoor, sRunFrom)
-- Assegno le dimensioni
local L = tLatchParam.L
local H = tLatchParam.H
local T = tLatchParam.T
local sf = tLatchParam.sf
local rf = tLatchParam.rf
local d = tLatchParam.d
local p = tLatchParam.p
local jn = tLatchParam.jn
local L2 = tLatchParam.L2
local H2 = tLatchParam.H2
local cl = tLatchParam.cl
local D_X = tLatchParam.D_X
local D_Y = tLatchParam.D_Y
local invG = tLatchParam.invG
local smr = tLatchParam.smr
local DS = tLatchParam.DS
local est = tLatchParam.est
local kbs = tLatchParam.kbs
local pbs = tLatchParam.pbs
local ls = tLatchParam.ls
local DY = tLatchParam.DY
local bEqualTh = tLatchParam.bETh
local dws = tLatchParam.Dws
-- Assegno i nomi dei layer
local LG = tLatchParam.LG
local LM = tLatchParam.LM
local DM = 'DUMMY'
-- variabili per messaggi e settaggi vari
local sCompoName = tLatchParam.Nome
-- RunByComponetInterface
local RC = true
-- Variabili per risalita distaccata
local nDeltaMovX = 2
local nDeltaMovY = 2
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
-- set variabili per compatibilità con vecchi componenti
-- step face: per compatibilità con tutti i componenti, se non è definito lo setto = alla profondità cava
if not sf or abs(sf) <= GEO.EPS_SMALL then
sf = T
end
-- radius face: per compatibilità con tutti i componenti, se non è definito lo setto a 0
if not rf or abs(rf) <= GEO.EPS_SMALL then
rf = 0
end
if not D_Y then
D_Y = 0
end
if not smr then
smr = 0
end
-- Layer
local Dm
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName(Lg,sCompoName)
end
if nDrawMach > 0 then -- se abilitata geometria lavorazione
Dm = EgtGroup(Pz,GDB_RT.LOC) or GDB_ID.NULL -- layer disegni cerchi rappresentatte il diametro utensile
EgtSetName(Dm,DM)
end
local tHint = {}
local hint1
local hint, hintPk
local pIni, pEnd, pCen, pStartStep
-- creo lo stesso la geometria esterna perché viene utilizzata anche per creare il percorso di lavorazione
-- se non è previsto viene eliminato dopo
if LG and cl == 3 and rf > GEO.EPS_SMALL then -- se cava arrotondata da entrambe i lati e raggio valido
-- Costruzione della geometria principale
pIni = Point3d(((L/2)-rf),(H/2),0)
pCen = Point3d(((L/2)-rf),((H/2)-rf),0)
pEnd = Point3d((L/2),((H/2)-rf),0)
DrawAddCircleDrawCircle( pCen, rf, 90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (H/2)) > GEO.EPS_SMALL then -- se due raccordi
pEnd = Point3d((L/2),-(H/2)+rf,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d(((L/2)-rf),(-(H/2)+rf),0)
pEnd = Point3d(((L/2)-rf),-(H/2),0)
DrawAddCircleDrawCircle( pCen, rf, 0,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(-((L/2)-rf),-(H/2),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pCen = Point3d(-((L/2)-rf),(-(H/2)+rf),0)
pEnd = Point3d(-(L/2),(-(H/2)+rf),0)
DrawAddCircleDrawCircle( pCen, rf, -90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (H/2)) > GEO.EPS_SMALL then -- se due raccordi
pEnd = Point3d(-(L/2),((H/2)-rf),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d(-((L/2)-rf),((H/2)-rf),0)
pEnd = Point3d(-((L/2)-rf),(H/2),0)
DrawAddCircleDrawCircle( pCen, rf, 180,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(((L/2)-rf),(H/2),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
elseif LG and cl == 1 and rf > GEO.EPS_SMALL then -- se cava arrotondata a sinistra e raggio valido
-- Costruzione della geometria principale
if smr ~= 0 then
pIni = Point3d(((L-rf)/2),(H/2)-0.5,0)
pEnd = Point3d(((L-rf)/2),-(H/2)+0.5,0)
else
pIni = Point3d(((L-rf)/2),(H/2),0)
pEnd = Point3d(((L-rf)/2),-(H/2),0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr ~= 0 then
pCen = Point3d(((L-rf)/2)-0.5,-(H/2)+0.5,0)
pEnd = Point3d(((L-rf)/2)-0.5,-(H/2),0)
DrawAddCircleDrawCircle( pCen, 0.5, 0,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pEnd = Point3d(-((L-rf)/2),-(H/2),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pCen = Point3d(-((L-rf)/2),(-(H/2)+rf),0)
pEnd = Point3d(-((L-rf)/2)-rf,(-(H/2)+rf),0)
DrawAddCircleDrawCircle( pCen, rf, -90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (H/2)) > GEO.EPS_SMALL then -- se due raccordi
pEnd = Point3d(-((L-rf)/2)-rf,((H/2)-rf),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d(-((L-rf)/2),((H/2)-rf),0)
pEnd = Point3d(-((L-rf)/2),(H/2),0)
DrawAddCircleDrawCircle( pCen, rf, 180,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr ~= 0 then
pEnd = Point3d(((L-rf)/2)-0.5,(H/2),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pCen = Point3d(((L-rf)/2)-0.5,(H/2)-0.5,0)
pEnd = Point3d(((L-rf)/2),(H/2)-0.5,0)
DrawAddCircleDrawCircle( pCen, 0.5, 90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
else
pEnd = Point3d(((L-rf)/2),(H/2),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
end
elseif LG and cl == 2 and rf > GEO.EPS_SMALL then -- se cava arrotondata a destra e raggio valido
-- Costruzione della geometria principale
pIni = Point3d(((L-rf)/2),(H/2),0)
pCen = Point3d(((L-rf)/2),((H/2)-rf),0)
pEnd = Point3d(((L-rf)/2)+rf,((H/2)-rf),0)
DrawAddCircleDrawCircle( pCen, rf, 90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (H/2)) > GEO.EPS_SMALL then -- se due raccordi
pEnd = Point3d(((L-rf)/2)+rf,(-(H/2)+rf),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d(((L-rf)/2),(-(H/2)+rf),0)
pEnd = Point3d(((L-rf)/2),-(H/2),0)
DrawAddCircleDrawCircle( pCen, rf, 0,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr ~= 0 then
pEnd = Point3d(-((L-rf)/2)+0.5,-(H/2),0)
else
pEnd = Point3d(-((L-rf)/2),-(H/2),0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr ~= 0 then
pCen = Point3d(-((L-rf)/2)+0.5,-(H/2)+0.5,0)
pEnd = Point3d(-((L-rf)/2),-(H/2),0)
DrawAddCircleDrawCircle( pCen, 0.5, -90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(-((L-rf)/2),(H/2)-0.5,0)
else
pEnd = Point3d(-((L-rf)/2),(H/2),0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr ~= 0 then
pCen = Point3d(-((L-rf)/2)+0.5,(H/2)-0.5,0)
pEnd = Point3d(-((L-rf)/2)+0.5,(H/2),0)
DrawAddCircleDrawCircle( pCen, 0.5, 180,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pEnd = Point3d(((L-rf)/2),(H/2),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
elseif LG then -- cava non arrotondata
-- Costruzione della geometria principale
if est and bEqualTh then -- se altro materiale e altezza come lo spessore porta
pIni = Point3d(0,((H/2)+(d/2)+0.5),0)
else
pIni = Point3d(0,(H/2),0)
end
if smr < 0 then -- se inserimento a sinistra
pEnd = Point3d((L/2)-0.5,(H/2),0)
else
if est and bEqualTh then -- se altro materiale e altezza come lo spessore porta
pEnd = Point3d(L/2,((H/2)+(d/2)+0.5),0)
else
pEnd = Point3d(L/2,(H/2),0)
end
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr < 0 then -- se inserimento a sinistra
pCen = Point3d((L/2)-0.5,(H/2)-0.5,0)
pEnd = Point3d((L/2),(H/2)-0.5,0)
DrawAddCircleDrawCircle( pCen, 0.5, 90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(L/2,-(H/2)+0.5,0)
else
if est and bEqualTh then -- se altro materiale e altezza come lo spessore porta
pEnd = Point3d(L/2,-((H/2)+(d/2)+0.5),0)
else
pEnd = Point3d(L/2,-(H/2),0)
end
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr < 0 then -- se inserimento a sinistra
pCen = Point3d((L/2)-0.5,-(H/2)+0.5,0)
pEnd = Point3d((L/2)-0.5,-(H/2),0)
DrawAddCircleDrawCircle( pCen, 0.5, 0,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
if smr > 0 then -- se inserimento a destra
pEnd = Point3d(-(L/2)+0.5,-(H/2),0)
else
if est and bEqualTh then -- se altro materiale e altezza come lo spessore porta
pEnd = Point3d(-L/2,-((H/2)+(d/2)+0.5),0)
else
pEnd = Point3d(-L/2,-(H/2),0)
end
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr > 0 then -- se inserimento a destra
pCen = Point3d(-(L/2)+0.5,-(H/2)+0.5,0)
pEnd = Point3d(-(L/2),-(H/2)+0.5,0)
DrawAddCircleDrawCircle( pCen, 0.5, -90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(-(L/2),(H/2)-0.5,0)
else
if est and bEqualTh then -- se altro materiale e altezza come lo spessore porta
pEnd = Point3d(-L/2,((H/2)+(d/2)+0.5),0)
else
pEnd = Point3d(-L/2,(H/2),0)
end
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if smr > 0 then -- se inserimento a destra
pCen = Point3d(-(L/2)+0.5,(H/2)-0.5,0)
pEnd = Point3d(-(L/2)+0.5,(H/2),0)
DrawAddCircleDrawCircle( pCen, 0.5, 180,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
if est and bEqualTh then -- se altro materiale e altezza come lo spessore porta
pEnd = Point3d(0,((H/2)+(d/2)+0.5),0)
else
pEnd = Point3d(0,(H/2),0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
end
-- trasformo in geometria composita i/il percorsi/o di contorno
-- primo percorso
if ( #tHint > 0) then
hint = EgtCurveCompo( Lg, tHint, true)
if hint then
EgtModifyCurveThickness(hint, -T)
EgtSetName(hint,LG)
if est and not bEqualTh then -- se altro materiale e altezza diversa da spessore porta
if L > H then -- se lunghezza maggiore di altezza cambio il punto di inizio del percorso
EgtChangeClosedCurveStartPoint( hint, Point3d( -(L/2), 0, 0))
end
end
end
end
---------------------------------------------
---------------------------------------------
-- Costruzione delle geometrie di lavorazione
---------------------------------------------
---------------------------------------------
if nDrawMach > 0 and LM then -- se abilitata geometria lavorazione
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
local tPocket = {}
local nRadius, hint_ofs, hint_ofs2
local nCase
local nCaseNext
local dZedStart
local dZedWork
local nStep
local dStep
local nDirVers
local nPass
---------------------------------------
-- geometria svuotatura giro esterno
---------------------------------------
-- individuo in che caso sono
if abs(H-d) < 0.03 then -- solo 1 passaggio in centro
nCase = 1
elseif (H-d) <= ( d*0.98) then -- solo passaggio di contornatura
nCase = 2
elseif ((H-d) > ( d*0.98)) and ( (H-d) <= (d*(1+p))) then -- passaggio di contornatura + un passaggio centrale
nCase = 3
elseif (H-d) > (d*(1+p)) then -- passaggio di contornatura + passaggi zig zag
nCase = 4
end
nStep = ceil(T/sf) -- numero di passate
dStep = (T/nStep) -- passo ricalcolato
dZedStart = 0
nRadius = (H/2)
if nCase == 1 then -- solo 1 passaggio in centro
nPass = 1
nDirVers = 1
dZedStart = 0
pEnd = Point3d((-nDirVers*((L-d)/2))*invG,0,dZedStart) -- nuovo punto finale
local nDoubleStep = nStep * 2
while nPass <= nDoubleStep do
-- primo mezzo passo
nDirVers = - nDirVers
pIni = pEnd
dZedWork = dZedStart - ((dStep * nPass)/2)
if nPass == nDoubleStep then
dZedWork = -T
end
pEnd = Point3d((-nDirVers*((L-d)/2))*invG,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
nPass = nPass + 1
end
-- ultimo mezzo passo
nDirVers = - nDirVers
pIni = pEnd
dZedWork = -T
pEnd = Point3d((-nDirVers*((L-d)/2))*invG,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
pIni = pEnd
if jn then -- se uso un solo utensile mi porto in posizione di partenza per la prossima geometria
-- calcolo in che caso sono con la prossima geometria
if abs(H2-d) < 0.03 then -- solo 1 passaggio in centro
nCaseNext = 1
else
nCaseNext = 0
end
pIni = pEnd
if ( nCaseNext == 1) then -- se solo passaggio in centro parto dalla parte opposta
pEnd = Point3d((-(((L2-d)/2)*invG)+D_X),D_Y,dZedWork)
else
pEnd = Point3d(((((L2-d)/2)*invG)+D_X),((H2-d)/2)+D_Y,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
else
-- Uscita in Z0
dZedWork = 0
if ( nDeltaMovX > (L-d)) then
nDeltaMovX = (L-d)
end
pEnd = Point3d(-nDirVers*(((L-d)/2)-nDeltaMovX)*invG,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
end
-- solo contornatura or contornatura + un passaggio centrale or contornatura + passaggi svuotatura
elseif ( nCase == 2) or ( nCase == 3) or ( nCase == 4) then
nPass = 1
nDirVers = 1
dZedStart = 0
while nPass <= nStep do
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T
end
if cl > 0 and rf > GEO.EPS_SMALL then -- se cava arrotondata
-- calcolo il raggio rimanente
nRadius = nRadius - (d/2)
-- copia del percorso per offset
hint_ofs = EgtCopyGlob( hint, Lg)
-- offset
local nId1 = EgtOffsetCurveAdv( hint_ofs, (d/2), GDB_OT.FILLET)
if nId1 and nId1 > 0 then
-- cancello il percorso originale e lo sostituisco con il nuovo id offsettato
EgtErase( hint_ofs)
hint_ofs = nId1
-- muovo la geometria in Z
EgtMove( hint_ofs, Point3d(0,0,dZedWork) - ORIG())
-- se flag inverso, inverto la geometria, solo qui non nelle altre copie
if invG < 0 then
EgtInvertCurve(hint_ofs)
end
if invG > 0 then -- se non è invertito
-- prima linea entrante
if cl == 3 then -- se cava arrotondata da entrambe i lati
pIni = Point3d(((L-H)/4),((H-d)/2),dZedStart)
elseif cl == 0 then
pIni = Point3d(((L-d)/4),((H-d)/2),dZedStart)
else
pIni = Point3d(((L-(H/2))/4),((H-d)/2),dZedStart)
end
pEnd = EgtSP( hint_ofs)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
else -- giro inverso
-- arco o linea entrante
if cl == 3 then -- se cava arrotondata da entrambe i lati
if rf == (H/2) then
pIni = Point3d(((L-d)/2),0,dZedStart)
pCen = Point3d(((L-H)/2),0,dZedStart)
else
pIni = Point3d(((L-d)/2),0,dZedStart)
end
elseif cl == 1 then -- arrotondata a sinistra
pIni = Point3d(((L-(H/2)-d)/2),0,dZedStart)
elseif cl == 2 then -- arrotondata a destra
pIni = Point3d(((L+(H/2)-d)/2),0,dZedStart)
pCen = Point3d(((L-(H/2))/2),0,dZedStart)
end
pEnd = EgtSP( hint_ofs)
if cl == 1 then -- arrotondata a sinistra
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
else
if rf == (H/2) then
hint1 = EgtArcCPA( Lg, pCen, pIni, 90, ( dZedWork - dZedStart), GDB_RT.LOC)
table.insert( tPocket, hint1)
else
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
end
end
end
pEnd = EgtEP( hint_ofs)
pStartStep = Point3d( pIni:getX(), pIni:getY(), pEnd:getZ())
-- faccio una copia del percorso offsettato per i prossimi offset
hint_ofs2 = EgtCopyGlob( hint_ofs, Lg)
table.insert( tPocket, hint_ofs)
end
else
-- prima linea entrante
pIni = Point3d(((L-d)/4)*invG,((H-d)/2),dZedStart)
pEnd = Point3d(((L-d)/2)*invG,((H-d)/2),dZedWork)
pStartStep = Point3d( pIni:getX(), pIni:getY(), pEnd:getZ())
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
-- prima linea contorno
pIni = pEnd
pEnd = Point3d(((L-d)/2)*invG,-((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
-- seconda linea contorno
pIni = pEnd
pEnd = Point3d(-((L-d)/2)*invG,-((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
-- terza linea contorno
pIni = pEnd
pEnd = Point3d(-((L-d)/2)*invG,((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
-- quarta linea contorno
pIni = pEnd
pEnd = Point3d(((L-d)/2)*invG,((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
end
if nCase == 2 then -- passaggio di contornatura
-- cancello copia dell'offset
if hint_ofs2 then EgtErase( hint_ofs2) end
-- verifico se il tratto di uscita in X e Y è più grande dello spazio interno e nel caso lo riduco
if L-d < nDeltaMovX then
nDeltaMovX = (L-d) / 2
end
if H-d < nDeltaMovY then
nDeltaMovY = (H-d) / 2
end
if cl > 0 and rf > GEO.EPS_SMALL then -- se cava arrotondata
pEnd2 = Point3d(( pEnd:getX() - nDeltaMovX),(pEnd:getY()-nDeltaMovY),0)
else
pEnd2 = Point3d(( pEnd:getX()-(nDeltaMovX*invG)),(pEnd:getY()-nDeltaMovY),0)
end
elseif nCase == 3 then -- passaggio di contornatura + un passaggio centrale
-- verifico se il tratto di uscita in X è più grande dello spazio interno e nel caso lo riduco
if L-d < nDeltaMovX then
nDeltaMovX = (L-d) / 2
end
if cl > 0 and rf > GEO.EPS_SMALL then -- se cava arrotondata
-- cancello copia dell'offset
if hint_ofs2 then EgtErase( hint_ofs2) end
-- linea posizionamento passata centrale
pIni = pEnd
if cl == 3 then -- se cava arrotondata da entrambe i lati
pEnd = Point3d(((L-H)/2),0,dZedWork)
elseif cl == 1 then -- se cava arrotondata a sinistra
pEnd = Point3d((((L-(H/2))/2)-((d*3)/4)),0,dZedWork)
elseif cl == 2 then -- se cava arrotondata a destra
pEnd = Point3d(((L-(H/2))/2),0,dZedWork)
else
pEnd = Point3d((((L*2)-(d*3))/4),0,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, YELLOW(), YELLOW())
-- linea passata centrale
pIni = pEnd
if cl == 3 then -- se cava arrotondata da entrambe i lati
pEnd = Point3d(-((L-H)/2),0,dZedWork)
elseif cl == 1 then -- se cava arrotondata a sinistra
pEnd = Point3d(-((L-(H/2))/2),0,dZedWork)
elseif cl == 2 then -- se cava arrotondata a destra
pEnd = Point3d(-(((L-(H/2))/2)-((d*3)/4)),0,dZedWork)
else
pEnd = Point3d(-(((L*2)-(d*3))/4),0,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, YELLOW(), YELLOW())
pEnd2 = Point3d(( pEnd:getX() + nDeltaMovX),pEnd:getY(),0)
else
-- quinta linea posizionamento passata centrale
pIni = pEnd
pEnd = Point3d((((L*2)-(d*3))/4)*invG,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
-- sesta linea passata centrale
pIni = pEnd
pEnd = Point3d(-(((L*2)-(d*3))/4)*invG,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
pEnd2 = Point3d(( pEnd:getX()+(nDeltaMovX*invG)),pEnd:getY(),0)
end
elseif nCase == 4 then -- passaggio di contornatura + passaggi svuotatura
local nDistYcentr = (d*p)
local bContinue
-- verifico se il tratto di uscita in X è più grande dello spazio interno e nel caso lo riduco
if L-d < nDeltaMovX then
nDeltaMovX = (L-d) / 2
end
if cl > 0 and rf > GEO.EPS_SMALL then -- se cava arrotondata
-- se percorso offset esiste
if hint_ofs2 then
-- faccio l'offset del raggio fresa
nRadius = nRadius - nDistYcentr
bContinue = nRadius > 0
-- se non posso continuare
if not bContinue then
EgtErase( hint_ofs2)
end
-- ciclo passate svuotatura
while bContinue do
hint_ofs = hint_ofs2
local nId1 = EgtOffsetCurveAdv( hint_ofs, nDistYcentr*invG, GDB_OT.FILLET)
if nId1 and nId1 > 0 then
-- cancello il percorso originale e lo sostituisco con il nuovo id offsettato
EgtErase( hint_ofs)
hint_ofs = nId1
-- linea congiunzione tra osset
pIni = pEnd
pEnd = EgtSP( hint_ofs)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
pEnd = EgtEP( hint_ofs)
-- faccio una copia del percorso offsettato per i prossimi offset
hint_ofs2 = EgtCopyGlob( hint_ofs, Lg)
table.insert( tPocket, hint_ofs)
-- calcolo nuovo passo in Y e indice direzione
nRadius = nRadius - nDistYcentr
bContinue = nRadius > 0
if not bContinue then
EgtErase( hint_ofs2)
end
else
bContinue = false
EgtErase( hint_ofs)
end
end
pEnd2 = Point3d(( pEnd:getX()-(nDeltaMovX*invG)),pEnd:getY(),0)
end
else
local nDirVers = -1
local nPosYcentr = ((H-d)/2) - nDistYcentr
bContinue = nPosYcentr > -((H-d)/2)
-- linea posizionamento passaggi svuotatura
pIni = pEnd
pEnd = Point3d((-nDirVers * (((L*2)-(d*3))/4))*invG,nPosYcentr,dZedWork)
-- ciclo passate svuotatura
while bContinue do
-- linea affondamento in Y
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
-- linea passata in X
pIni = pEnd
pEnd = Point3d((nDirVers * (((L*2)-(d*3))/4))*invG,nPosYcentr,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
-- calcolo nuovo passo in Y e indice direzione
nPosYcentr = nPosYcentr - nDistYcentr
bContinue = nPosYcentr > -((H-d)/2)
-- calcolo prossimo punto solo se sono ancora dentro l'area
if bContinue then
nDirVers = -nDirVers
-- ricalcolo punti per linea successiva
pIni = pEnd
pEnd = Point3d((-nDirVers * (((L*2)-(d*3))/4))*invG,nPosYcentr,dZedWork)
end
end
pEnd2 = Point3d(( pEnd:getX()-(nDeltaMovX*invG*nDirVers)), pEnd:getY(),0)
end
end
nPass = nPass + 1
dZedStart = dZedStart - dStep
nRadius = (H/2)
-- se ho altri passi torno al punto di inizio
if nPass <= nStep then
pIni = pEnd
pEnd = pStartStep
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
end
end -- end while
if jn then -- se uso un solo utensile mi porto in posizione di partenza per la prossima geometria
-- calcolo in che caso sono con la prossima geometria
if abs(H2-d) < 0.03 then -- solo 1 passaggio in centro
nCaseNext = 1
else
nCaseNext = 0
end
pIni = pEnd
if ( nCaseNext == 1) then -- se solo passaggio in centro parto dalla parte opposta
pEnd = Point3d(((-((L2-d)/2)*invG)+D_X),D_Y,dZedWork)
else
pEnd = Point3d(((((L2-d)/2)*invG)+D_X),((H2-d)/2)+D_Y,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
else
-- Uscita in Z0
pIni = pEnd
DrawAddLineDrawCircle( pIni, pEnd2, Lg, tPocket, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
end
end
-- trasformo in geometria composita i/il percorsi/o di svuotatura
-- primo percorso
if ( #tPocket > 0) then
hintPk = EgtCurveCompo( Lg, tPocket, true)
if hintPk then
EgtModifyCurveThickness(hintPk, 0)
EgtSetName(hintPk,LM)
if sRunFrom and sRunFrom == 'OH' then -- se lanciato da over head completo gli spostamenti e assegnazioni
-- muovo la geometria verso sinistra del valore di L/2 + DS
EgtMove( hintPk, Point3d(-((L/2)+DS),DY,0) - ORIG())
EgtSetInfo( hintPk,'InserPoint' ,'Edge') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo( hintPk,'DeltaPos' ,( L+(2*DS)))
-- se mantiene lato anche su face
if kbs and kbs > 0 then
local sKeepMode = 'c' -- setto per mantenere il centro dello spessore
EgtSetInfo( hintPk, 'KeepBackSet', sKeepMode)
end
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( hintPk, 'ProbeSide', '1')
end
end
end
end
end
-- se abilitata solo geometria di lavorazione elimino il percorso di sola geometria
if nDrawMach == 1 then
if hint then
-- cancello il percorso
EgtErase( hint)
end
else -- altrimenti se lo mantengo, cambio il punto di inizio in base a certe condizioni
if hint then
if not est and cl and cl > 0 and rf and rf > GEO.EPS_SMALL then -- se materiale non steel e cava arrotondata da entrambe i lati e raggio valido
EgtChangeClosedCurveStartPoint( hint, Point3d(0,(H/2),0))
end
if sRunFrom and sRunFrom == 'OH' then -- se lanciato da over head completo gli spostamenti e assegnazioni
-- muovo la geometria verso sinistra del valore di L/2 + DS
EgtMove( hint, Point3d(-((L/2)+DS),DY,0) - ORIG())
EgtSetInfo( hint,'InserPoint' ,'Edge') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo( hint,'DeltaPos' ,( L+(2*DS)))
-- se mantiene lato anche su face
if kbs and kbs > 0 then
local sKeepMode = 'c' -- setto per mantenere il centro dello spessore
EgtSetInfo( hint, 'KeepBackSet', sKeepMode)
end
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( hint, 'ProbeSide', '1')
end
end
end
end
if nDrawMach > 0 and dws then
local nIdSideBoxUp
if hint then
nIdSideBoxUp = EgtCopyGlob( hint, Lg)
EgtSetName( nIdSideBoxUp, 'upper')
EgtSetInfo( nIdSideBoxUp, 'SideDoor', 'upper')
end
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if hint then
EgtSetColor(hint,AQUA())
end
if hintPk then
EgtSetColor(hintPk,AQUA())
end
else
if hint then
EgtSetColor(hint,ORANGE())
end
if hintPk then
EgtSetColor(hintPk,ORANGE())
end
end
else -- altrimenti non Preview
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase( Dm)
end
-- assegno nota su percorso svuotatura
if hintPk then
EgtSetInfo( hintPk, 'NotCheckDir', '1')
end
end
return hint, hintPk
end
return _Latch
+768
View File
@@ -0,0 +1,768 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- _LatchCorner.lua by EgalWare s.r.l. 2016.07.11
-- Autore: Filippo Monchi
-- Latch corner, componente di secondo livello, non può essere chiamato direttamente da un lua dei
-- componenti di interfaccia
-- 2017.09.05 V1.0a2 FM Manage lead-in on opposite side and anti-splint path V lead-in
-- 2018.05.15 V1.0a3 FM Add manage new mode to count entity also on curvecompo path to allow assign note on connection entity
-- 2019.10.11 V1.0a4 FM Manage steel option (disable to generate pocket paths and antisplint path, make closed and extend face path)
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.10.21 V2.001 FM Modify the closed path start point for steel material
-- 2024.07.19 V2.002 FM Set note 'NotCheckDir' to pocketing and antisplint paths
-- Tavola per definizione modulo (serve ma non usata)
local _LatchCorner = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- Valori limite
local dExtraH = 0.5
local sMaxFeed = 'MaxFeed'
local sRapid = 'Rapid'
-- contatori
local nTotContEnt = 0
local nTotContEnt_r = 0
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar, nCounter_r)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
local nNumLine
-- serve per il conteggio delle entità in caso di concatenamento con curvecompo
if nCounter_r then
nTotContEnt_r = nTotContEnt_r + 1
else
nTotContEnt = nTotContEnt + 1
end
if idTable then
table.insert( idTable, nLine)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumLine = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor( nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor( nCircle2, cColor2)
end
end
return nLine, nNumLine, sMVar
end
local function DrawAddCircleDrawCircle( pCenter, dRadius, dAngIni, dAngCen, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar, nCounter_r)
local nCircle = EgtArc( nGroup, pCenter, dRadius, dAngIni, dAngCen, 0, GDB_RT.LOC)
local nNumCircle
-- serve per il conteggio delle entità in caso di concatenamento con curvecompo
if nCounter_r then
nTotContEnt_r = nTotContEnt_r + 1
else
nTotContEnt = nTotContEnt + 1
end
if idTable then
table.insert( idTable, nCircle)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumCircle = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, EgtSP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, EgtEP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle2, cColor2)
end
end
return nCircle, nNumCircle, sMVar
end
-- Funzione di disegno
function _LatchCorner.Draw( EC, EM, tLatchParam, bPreview, bRunByCompo, nDrawMach, Pz, Lg, dThickDoor)
-- Assegno le dimensioni
local L = tLatchParam.L
local H = tLatchParam.H
local T = tLatchParam.T
local d = tLatchParam.d
local p = tLatchParam.p
local sf = tLatchParam.sf
local rf = tLatchParam.rf
local d2 = tLatchParam.d2
local jn = tLatchParam.jn
local L2 = tLatchParam.L2
local H2 = tLatchParam.H2
local cl = tLatchParam.cl
local D_X = tLatchParam.D_X
local est = tLatchParam.est
local invG = tLatchParam.invG
-- Assegno i nomi geometrie
local LG = tLatchParam.LG
local LM = tLatchParam.LM
local LA = tLatchParam.LA
local DM = 'DUMMY'
-- variabili per messaggi e settaggi vari
local sCompoName = tLatchParam.Nome
-- settaggio opzione per partenza ad angolo o meno
local bStartAng = true
local bStartOppo = true
-- RunByComponetInterface
local RC = true
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
-- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
-- set variabili per compatibilità con vecchi componenti
-- step face: per compatibilità con tutti i componenti, se non è definito lo setto = alla profondità cava
if not sf or abs(sf) <= GEO.EPS_SMALL then
sf = T
end
-- radius face: per compatibilità con tutti i componenti, se non è definito lo setto a 0
if not rf or abs(rf) <= GEO.EPS_SMALL then
rf = 0
end
-- Layer
local Dm
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName( Lg, sCompoName)
end
if nDrawMach > 0 then -- se abilitata geometria lavorazione
Dm = EgtGroup( Pz, GDB_RT.LOC) -- layer disegni cerchi rappresentatte il diametro utensile
EgtSetName(Dm,DM)
end
local tHint = {}
local hint1, hint2, hint3, hint4, hint5, hint5
local hint, hintPk, hintAs1
local pIni, pEnd, pCen, pStartStep
local nRadius = 0
-- se altezza supera lo spessore porta la riporto allo stesso valore
if H > dThickDoor then
H = dThickDoor
end
-- creo lo stesso la geometria esterna perché viene utilizzata anche per creare il percorso di lavorazione
-- se non è previsto viene eliminato dopo
-- Costruzione della geometria ( in senso orario)
if LG and (cl == 3 or cl == 2) and rf > GEO.EPS_SMALL then -- se cava arrotondata da entrambe i lati o a destra
if est then
pIni = Point3d(-((d/2)+dExtraH),-((H/2)-(d/2)-dExtraH),0)
pEnd = Point3d(-((d/2)+dExtraH),H/2,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
else
pIni = Point3d(0,H/2,0)
end
pEnd = Point3d((L-rf),H/2,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pCen = Point3d((L-rf),((H/2)-rf),0)
pEnd = Point3d(L,((H/2)-rf),0)
DrawAddCircleDrawCircle( pCen, rf, 90,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if abs(rf - (H/2)) > GEO.EPS_SMALL then -- se due raccordi
pEnd = Point3d(L,(-(H/2)+rf),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
pCen = Point3d((L-rf),(-(H/2)+rf),0)
pEnd = Point3d((L-rf),-(H/2),0)
DrawAddCircleDrawCircle( pCen, rf, 0,-90, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
if est then
pEnd = Point3d(-((d/2)+dExtraH),-H/2,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(-((d/2)+dExtraH),-((H/2)-(d/2)-dExtraH),0)
else
pEnd = Point3d(0,-H/2,0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
elseif LG then -- altrimenti cava squadrata
if est then
DrawAddLineDrawCircle( Point3d(-((d/2)+dExtraH),-((H/2)-(d/2)-dExtraH),0), Point3d(-((d/2)+dExtraH),H/2,0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
DrawAddLineDrawCircle( Point3d(-((d/2)+dExtraH),H/2,0), Point3d(L,H/2,0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
DrawAddLineDrawCircle( Point3d(L,H/2,0), Point3d(L,-H/2,0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
DrawAddLineDrawCircle( Point3d(L,-H/2,0), Point3d(-((d/2)+dExtraH),-H/2,0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
DrawAddLineDrawCircle( Point3d(-((d/2)+dExtraH),-H/2,0), Point3d(-((d/2)+dExtraH),-((H/2)-(d/2)-dExtraH),0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
else
DrawAddLineDrawCircle( Point3d(0,H/2,0), Point3d(L,H/2,0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
DrawAddLineDrawCircle( Point3d(L,H/2,0), Point3d(L,-H/2,0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
DrawAddLineDrawCircle( Point3d(L,-H/2,0), Point3d(0,-H/2,0),
Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
end
end
-- trasformo in geometria composita i/il percorsi/o di contorno
if ( #tHint > 0) then
hint = EgtCurveCompo( Lg, tHint, true)
if hint then
EgtModifyCurveThickness( hint, -T)
EgtSetName( hint, LG)
if est then
EgtSetInfo( hint, 'StartFromExt', 1)
end
end
end
---------------------------------------
---------------------------------------
-- Costruzione delle geometrie di lavorazione
---------------------------------------
---------------------------------------
if nDrawMach > 0 then -- se abilitata geometria lavorazione
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
local tPocketAs = {}
local nCaseNext
local dZedStart
local dZedWork
local nStep
local dStep
local nPass
local pStartStep
local nCase, nCaseNext
-- geometria antischeggia
if d2 then -- se parametro valido
if sf >= T then -- se passo unico
local dPosX, dEndPosX, dIniPosX, dDeltaPosY
if bStartAng then -- se lead-in con angolo
if (L-nRadius) >= (d2*3/4) then
dEndPosX = (d2/4)
else
if nRadius >= (d2/2) then -- se raggio >= raggio fresa
dEndPosX = (L-nRadius)
else
dEndPosX = (L-(d2/2))
end
end
dPosX = dEndPosX - (d2/8)
dIniPosX = dPosX - (d2*7/8)
dDeltaPosY = ( (d2*7/8) / tan(30))
-- linea entrante inclinata
pIni = Point3d( dIniPosX, (-((H-d2)/2) + 0.2 + dDeltaPosY)*invG,0)
pEnd = Point3d(dPosX, (-((H-d2)/2) + 0.2)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
-- linea entrante in X
pIni = pEnd
pEnd = Point3d(dEndPosX, (-((H-d2)/2) + 0.2)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linee tangente al percorso
pIni = pEnd
pEnd = Point3d(dEndPosX, -((H-d2)/2)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linea di uscita
pIni = pEnd
pEnd = Point3d(-(d2*3/4),-((H-d2)/2)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
else -- lead-in diritto
if (L-nRadius) >= (d2*3/4) then
dEndPosX = (d2/4)
else
if nRadius >= (d2/2) then -- se raggio >= raggio fresa
dEndPosX = (L-nRadius)
else
dEndPosX = (L-(d2/2))
end
end
dIniPosX = -(d2*3/4)
pIni = Point3d(dIniPosX,-((H-d2)/2)*invG,0)
pEnd = Point3d(dEndPosX,-((H-d2)/2)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
end
-- trasformo in geometria composita
if ( #tPocketAs > 0) then
hintAs1 = EgtCurveCompo( Lg, tPocketAs, true)
if hintAs1 then
EgtModifyCurveThickness(hintAs1, -T)
EgtSetName(hintAs1,LA)
end
end
else -- altrimenti più passate
nStep = ceil(T/sf) -- numero di passate
dStep = (T/nStep) -- passo ricalcolato
nPass = 1
dZedStart = 0
local tMVar = {}
local tMVar2 = {}
local nConEnt
local sKindVar
local dPosX, dEndPosX, dIniPosX, dDeltaPosY
while nPass <= nStep do
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T
end
if bStartAng then -- se lead-in con angolo
if (L-nRadius) >= (d2*3/4) then
dEndPosX = (d2/4)
else
if nRadius >= (d2/2) then -- se raggio >= raggio fresa
dEndPosX = (L-nRadius)
else
dEndPosX = (L-(d2/2))
end
end
dPosX = dEndPosX - (d2/8)
dIniPosX = dPosX - (d2*7/8)
dDeltaPosY = ( (d2*7/8) / tan(30))
-- linea entrante inclinata
pIni = Point3d( dIniPosX, (-((H-d2)/2) + 0.2 + dDeltaPosY)*invG,dZedWork)
pEnd = Point3d(dPosX, (-((H-d2)/2) + 0.2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
-- linea entrante in X
pIni = pEnd
pEnd = Point3d(dEndPosX, (-((H-d2)/2) + 0.2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linee tangente al percorso
pIni = pEnd
pEnd = Point3d(dEndPosX, -((H-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linea di uscita
pIni = pEnd
pEnd = Point3d(-(d2*3/4),-((H-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni = pEnd
pEnd = Point3d( pIni:getX(), (-((H-d2)/2) + 0.2 + dDeltaPosY)*invG, dZedWork)
else -- lead-in diritto
if (L-nRadius) >= (d2*3/4) then
dEndPosX = (d2/4)
else
if nRadius >= (d2/2) then -- se raggio >= raggio fresa
dEndPosX = (L-nRadius)
else
dEndPosX = (L-(d2/2))
end
end
dIniPosX = -(d2*3/4)
pIni = Point3d(dIniPosX,(-((H-d2)/2) + 0.2)*invG,dZedWork)
pEnd = Point3d(dEndPosX,(-((H-d2)/2) + 0.2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
-- faccio il ritorno alla posizione di partenza
pIni = pEnd
pEnd = Point3d(dEndPosX, -((H-d2)/2)*invG, dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni = pEnd
pEnd = Point3d(dIniPosX, pIni:getY(), dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni = pEnd
pEnd = Point3d(pIni:getX(),(-((H-d2)/2) + 0.2)*invG, dZedWork)
end
nPass = nPass + 1
dZedStart = dZedWork
-- se ho altri passi scendo in z
if nPass <= nStep then
local pIniLoc = pEnd
pEnd = Point3d(pIniLoc:getX(), pIniLoc:getY(), (dZedStart - dStep))
_, nConEnt, sKindVar = DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true,
ORANGE(), ORANGE(), sMaxFeed)
table.insert( tMVar, {nConEnt,sKindVar})
end
end -- end while
-- trasformo in geometria composita
if ( #tPocketAs > 0) then
hintAs1 = EgtCurveCompo( Lg, tPocketAs, true)
if hintAs1 then
EgtModifyCurveThickness( hintAs1, 0)
-- assegno nota con la lista delle entità di variazione
local sListEnt = ''
for i = 1, #tMVar do
sListEnt = sListEnt .. '{ ent=' .. EgtNumToString( tMVar[i][1], 0) .. ', ' .. 'code=' .. tMVar[i][2] .. '}'
if i < #tMVar then
sListEnt = sListEnt .. ','
end
end -- end for
if string.len( sListEnt) > 0 then EgtSetInfo( hintAs1, 'MVar', sListEnt) end
EgtSetName(hintAs1,LA)
end
end
end
end
---------------------------------------
-- geometria svuotatura giro esterno
---------------------------------------
if not est then -- se non c'è lavorazione steel
-- individuo in che caso sono
if abs(H-d) < 0.03 then -- solo 1 passaggio in centro
nCase = 1
elseif (H-d) <= ( d*0.98) then -- solo passaggio di contornatura
nCase = 2
elseif ((H-d) > ( d*0.98)) and ( (H-d) <= (d*(1+p))) then -- passaggio di contornatura + un passaggio centrale
nCase = 3
elseif (H-d) > (d*(1+p)) then -- passaggio di contornatura + passaggi offset
nCase = 4
end
local nDirVers = 1
local tPocket = {}
local tMVar = {}
local nConEnt
local sKindVar
-- resetto contatori entità
nTotContEnt = 0
nTotContEnt_r = 0
nRadius = H/2
nPass = 1
dZedStart = 0
nStep = ceil(T/sf) -- numero di passate
dStep = (T/nStep) -- passo ricalcolato
while nPass <= nStep do
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T
end
if nCase == 1 then -- solo 1 passaggio in centro
if nDirVers == 1 then -- se passata di andata
pIni = Point3d(-(d*3/4),0,dZedWork)
pStartStep = pIni
pEnd = Point3d((L-(d/2)),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
-- se non sono all'ultima passata scendo in Z
if nPass < nStep then
pIni = pEnd
pEnd = Point3d((L-(d/2)),0,(dZedWork-dStep))
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
end
else -- altrimenti passata di ritorno
pIni = Point3d((L-(d/2)),0,dZedWork)
pEnd = Point3d(-(d*3/4),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
-- se non sono all'ultima passata scendo in Z
if nPass < nStep then
pIni = pEnd
pEnd = Point3d(-(d*3/4),0,(dZedWork-dStep))
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
end
end
if nPass == nStep then
if jn then -- se uso un solo utensile mi porto in posizione di partenza per la prossima geometria
pIni = pEnd
pEnd = Point3d((L2-(d/2))+D_X,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
-- solo contornatura or contornatura + un passaggio centrale or contornatura + passaggi svuotatura
elseif ( nCase == 2) or ( nCase == 3) or ( nCase == 4) then
-- calcolo l'ampiezza dell'offset
nRadius = nRadius - (d/2)
-- offset
hint_ofs = EgtOffsetCurveAdv( hint, (d/2), GDB_OT.FILLET)
if hint_ofs and hint_ofs > 0 then
-- muovo la geometria in Z
EgtMove( hint_ofs, Point3d(0,0,dZedWork) - ORIG())
-- se flag inverso, inverto la geometria, solo qui non nelle altre copie
if invG < 0 then
EgtInvertCurve(hint_ofs)
end
if bStartOppo then
pIni = Point3d(-(d*3/4),(-((H-d)/2) + 0.2)*invG,dZedWork)
pStartStep = pIni
-- linea in X con centro utensile fuori
pEnd = Point3d(-dExtraH,(-((H-d)/2) + 0.2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
-- linea traversa in Y per andare sul vecchio punto iniziale (in Y)
pIni = pEnd
pEnd = Point3d(-dExtraH,((H-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
-- linea entrante a prendere il percorso di offset
pIni = pEnd
pEnd = EgtSP( hint_ofs)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
pEnd = EgtEP( hint_ofs)
local ntypeDom, nNumCurve = EgtCurveDomain(hint_ofs)
nTotContEnt = nTotContEnt + ( nNumCurve - ntypeDom)
table.insert( tPocket, hint_ofs)
else
-- prima linea entrante
pIni = Point3d(-(d*3/4),((H-d)/2)*invG,dZedWork)
pStartStep = pIni
pEnd = EgtSP( hint_ofs)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
pEnd = EgtEP( hint_ofs)
local ntypeDom, nNumCurve = EgtCurveDomain(hint_ofs)
nTotContEnt = nTotContEnt + ( nNumCurve - ntypeDom)
table.insert( tPocket, hint_ofs)
end
end
if nCase == 3 then -- passaggio di contornatura + un passaggio centrale
-- linea posizionamento passata centrale
pIni = pEnd
pEnd = Point3d(-dExtraH,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, YELLOW(), YELLOW())
-- linee passata centrale
pIni = pEnd
pEnd = Point3d((L-(d*3/4)),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, YELLOW(), YELLOW())
pIni = pEnd
-- se non sono all'ultima passata ritorno al punto di inizio della passata centrale,
-- si perde un po' di tempo ma è l'unica per poter rifare il passo
if nPass < nStep then
pEnd = Point3d(-dExtraH,0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, YELLOW(), YELLOW())
pIni = pEnd
end
elseif nCase == 4 then -- passaggio di contornatura + passaggi svuotatura
local nDistYcentr = (d*p)
local bContinue
-- se percorso offset esiste
if hint_ofs and hint_ofs > 0 then
-- faccio l'offset del raggio fresa
nRadius = nRadius - nDistYcentr
bContinue = nRadius > 0
-- se percorso offset esiste
while bContinue do
hint_ofs2 = EgtOffsetCurveAdv( hint_ofs, nDistYcentr*invG, GDB_OT.FILLET)
if hint_ofs2 and hint_ofs2 > 0 then
-- linea congiunzione tra osset
pIni = pEnd
pEnd = EgtSP( hint_ofs2)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
pEnd = EgtEP( hint_ofs2)
hint_ofs = hint_ofs2
local ntypeDom, nNumCurve = EgtCurveDomain(hint_ofs)
nTotContEnt = nTotContEnt + ( nNumCurve - ntypeDom)
table.insert( tPocket, hint_ofs)
-- calcolo nuovo passo in Y e indice direzione
nRadius = nRadius - nDistYcentr
bContinue = nRadius > 0
else
bContinue = false
end
end -- end while
end
end
if nPass == nStep then
if jn then -- se uso un solo utensile mi porto in posizione di partenza per la prossima geometria
-- carcolo in che caso sono con la prossima geometria
if abs(H2-d) < 0.03 then -- solo 1 passaggio in centro
nCaseNext = 1
else
nCaseNext = 0
end
pIni = pEnd
if ( nCaseNext == 1) then -- se solo passaggio in centro parto dalla parte opposta
pEnd = Point3d((L2-(d/2))+D_X,0,dZedWork)
else
pEnd = Point3d((-(d*3/4))+D_X,((H2-d)/2)*invG,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
end
nPass = nPass + 1
dZedStart = dZedStart - dStep
nRadius = H/2
nDirVers = -nDirVers
-- se ho altri passi torno al punto di inizio
if nPass <= nStep and nCase > 1 then
pIni = pEnd
pEnd = Point3d(pStartStep:getX(),pStartStep:getY(),(dZedStart - dStep))
_, nConEnt, sKindVar = DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW(), sMaxFeed)
table.insert( tMVar, {nTotContEnt,sKindVar})
end
end -- end while
-- trasformo in geometria composita
if ( #tPocket > 0) then
hintPk = EgtCurveCompo( Lg, tPocket, true)
if hintPk then
EgtModifyCurveThickness(hintPk, 0)
-- assegno nota con la lista delle entità di variazione
local sListEnt = ''
for i = 1, #tMVar do
sListEnt = sListEnt .. '{ ent=' .. EgtNumToString( tMVar[i][1], 0) .. ', ' .. 'code=' .. tMVar[i][2] .. '}'
if i < #tMVar then
sListEnt = sListEnt .. ','
end
end -- end for
if string.len( sListEnt) > 0 then EgtSetInfo( hintPk, 'MVar', sListEnt) end
EgtSetName(hintPk,LM)
end
end
end
end
-- se abilitata solo geometria di lavorazione elimino il percorso di sola geometria
if nDrawMach == 1 then
if hint then
-- cancello il percorso
EgtErase( hint)
end
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if hint then
EgtSetColor(hint,AQUA())
end
if hintAs1 then
EgtSetColor(hintAs1,AQUA())
end
if hintPk then
EgtSetColor(hintPk,AQUA())
end
else
if hint then
EgtSetColor(hint,ORANGE())
end
if hintAs1 then
EgtSetColor(hintAs1,ORANGE())
end
if hintPk then
EgtSetColor(hintPk,ORANGE())
end
end
else -- altrimenti non Preview
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase(Dm)
end
-- assegno nota su percorsi antisplint e svuotatura
if hintAs1 then
EgtSetInfo( hintAs1, 'NotCheckDir', '1')
end
if hintPk then
EgtSetInfo( hintPk, 'NotCheckDir', '1')
end
end
return hint, hintPk, hintAs1
end
return _LatchCorner
+753
View File
@@ -0,0 +1,753 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- _LatchStrike.lua by EgalWare s.r.l. 2016.07.11
-- Autore: Filippo Monchi
-- Latch strike, componente di secondo livello, non può essere chiamato direttamente da un lua dei
-- componenti di interfaccia
-- 2017.02.20 V1.0a1 FM Manage step face and radius face features
-- 2017.09.05 V1.0a2 FM Manage lead-in on opposite side and anti-splint path V lead-in
-- 2019.10.11 V1.0a3 FM Manage steel option (disable to generate pocket paths and antisplint path, make closed and extend face path)
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2019.10.21 V2.001 FM Modify the closed path start point for steel material
-- 2024.07.19 V2.002 FM Set note 'NotCheckDir' to pocketing and antisplint paths
-- Tavola per definizione modulo (serve ma non usata)
local LatchStrike = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- Valori limite
local dExtraH = 0.5
local sMaxFeed = 'MaxFeed'
local sRapid = 'Rapid'
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
local nNumLine
if idTable then
table.insert( idTable, nLine)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumLine = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor( nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor( nCircle2, cColor2)
end
end
return nLine, nNumLine, sMVar
end
local function DrawAddCircleDrawCircle( pCenter, dRadius, dAngIni, dAngCen, nGroup, idTable, bPrev, nGroupCirc,
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar)
local nCircle = EgtArc( nGroup, pCenter, dRadius, dAngIni, dAngCen, 0, GDB_RT.LOC)
local nNumCircle
if idTable then
table.insert( idTable, nCircle)
-- se devo inserire una variazione nell'entità
if sMVar then
nNumCircle = #idTable
end
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, EgtSP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, EgtEP( nCircle), nRad , GDB_RT.LOC)
EgtSetColor( nCircle2, cColor2)
end
end
return nCircle, nNumCircle, sMVar
end
-- Funzione di disegno
function LatchStrike.Draw( EC, EM, tLatchParam, bPreview, bRunByCompo, nDrawMach, Pz, Lg, dThickDoor)
-- Assegno le dimensioni
local L = tLatchParam.L
local H = tLatchParam.H
local T = tLatchParam.T
local d = tLatchParam.d
local p = tLatchParam.p
local sf = tLatchParam.sf
local R = tLatchParam.rf
local d2 = tLatchParam.d2
local jn = tLatchParam.jn
local L2 = tLatchParam.L2
local H2 = tLatchParam.H2
local D = tLatchParam.D
local D_X = tLatchParam.D_X
local invG = tLatchParam.invG
local est = tLatchParam.est
-- Assegno i nomi geometrie
local LG = tLatchParam.LG
local LM = tLatchParam.LM
local LA = tLatchParam.LA
local DM = 'DUMMY'
-- variabili per messaggi e settaggi vari
local sCompoName = tLatchParam.Nome
-- settaggio opzione per partenza ad angolo o meno
local bStartAng = true
local bStartOppo = tLatchParam.staro
if bStartOppo == nil then
bStartOppo = true
end
-- RunByComponetInterface
local RC = true
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
-- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
-- set variabili per compatibilità con vecchi componenti
-- step face: per compatibilità con tutti i componenti, se non è definito lo setto = alla profondità cava
if not sf or abs(sf) <= GEO.EPS_SMALL then
sf = T
end
-- radius face: per compatibilità con tutti i componenti, se non è definito lo setto a 0
if not R or abs(R) <= GEO.EPS_SMALL then
R = 0
end
-- Layer
local Dm
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName( Lg, sCompoName)
end
if nDrawMach > 0 then -- se abilitata geometria lavorazione
Dm = EgtGroup( Pz, GDB_RT.LOC) -- layer disegni cerchi rappresentatte il diametro utensile
EgtSetName(Dm,DM)
end
local hint1, hint2
local hint, hintPk, hintAs1, hintAs2
local pIni, pEnd, pCen
local bThD
-- se altezza supera lo spessore porta la riporto allo stesso valore e resetto eventuale raccordo
if H >= dThickDoor then
H = dThickDoor
R = 0
bThD = true
end
if nDrawMach ~= 1 then -- se abilitata geometria esterna
local tHint = {}
-- Costruzione della geometria ( in senso orario)
if est then
pIni = Point3d(-((L/2)-(d/2)-dExtraH)*invG,((d/2)+dExtraH),0)
pEnd = Point3d((L/2*invG),((d/2)+dExtraH),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
else
pIni = Point3d((L/2*invG),0,0)
end
if R > 0 then
pEnd = Point3d(L/2*invG,(-H+R),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(((L/2)-R)*invG,-H,0)
pCen =Point3d(((L/2)-R)*invG,(-H+R),0)
DrawAddCircleDrawCircle( pCen, R, EgtIf( invG > 0, 0, 180),-90*invG, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
else
if est and bThD then
pEnd = Point3d(L/2*invG,-(H+(d/2)+dExtraH),0)
else
pEnd = Point3d(L/2*invG,-H,0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
if R > 0 then
pEnd = Point3d((-(L/2)+R)*invG,-H,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(-(L/2)*invG,(-H+R),0)
pCen =Point3d((-(L/2)+R)*invG,(-H+R),0)
DrawAddCircleDrawCircle( pCen, R, -90,-90*invG, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
else
if est and bThD then
pEnd = Point3d(-(L/2)*invG,-(H+(d/2)+dExtraH),0)
else
pEnd = Point3d(-(L/2)*invG,-H,0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
end
if est then
pEnd = Point3d(-L/2*invG,((d/2)+dExtraH),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
pEnd = Point3d(-((L/2)-(d/2)-dExtraH)*invG,((d/2)+dExtraH),0)
else
pEnd = Point3d(-L/2*invG,0,0)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tHint, bPreview, Dm, 0, false, false, RED(), RED())
pIni = pEnd
hint = EgtCurveCompo( Lg, tHint, true)
EgtModifyCurveThickness( hint, -T)
EgtSetName( hint, LG)
if est then
EgtSetInfo( hint, 'StartFromExt', 1)
end
end
----------------------------------------------
----------------------------------------------
-- Costruzione delle geometrie di lavorazione
----------------------------------------------
----------------------------------------------
if nDrawMach > 0 then -- se abilitata geometria lavorazione
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
local tPocketAs = {}
local tPocketAs2 = {}
local pIni2
local pEnd2
local nCaseNext
local dZedStart
local dZedWork
local nStep
local dStep
local nPass
local pStartStep
-- geometria antischeggia
if d2 then -- se parametro valido
nStep = ceil(T/sf) -- numero di passate
dStep = (T/nStep) -- passo ricalcolato
nPass = 1
dZedStart = 0
local tMVar = {}
local tMVar2 = {}
local nConEnt
local sKindVar
local dPosY, dEndPosY, dIniPosY, dDeltaPosX
local dPosY2, dEndPosY2, dIniPosY2
while nPass <= nStep do
dZedWork = dZedStart - dStep
if nPass == nStep then
if nStep == 1 then
dZedWork = 0
else
dZedWork = -T
end
end
if bStartAng then -- se lead-in con angolo
if H >= (d2*3/4) then
if (H-R) > (d2/4) then
dEndPosY = -(d2/4)
dEndPosY2 = -(H-(d2/4))
else
dEndPosY = -(H-R)
end
else
dEndPosY = -H+(d2/2)
end
dPosY = dEndPosY + (d2/8)
dPosY2 = dEndPosY2 - (d2/8)
dIniPosY = dPosY + (d2*7/8)
dIniPosY2 = dPosY2 - (d2*7/8)
dDeltaPosX = ( (d2*7/8) / tan(30))
-- linea entrante inclinata
pIni = Point3d((-((L-d2)/2) + 0.2 + dDeltaPosX)*invG, dIniPosY, dZedWork)
pEnd = Point3d((-((L-d2)/2) + 0.2)*invG, dPosY, dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
-- linea entrante in Y
pIni = pEnd
pEnd = Point3d((-((L-d2)/2) + 0.2)*invG, dEndPosY, dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linee tangente al percorso
pIni = pEnd
pEnd = Point3d(-((L-d2)/2)*invG, dEndPosY, dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linea di uscita
pIni = pEnd
pEnd = Point3d(-((L-d2)/2)*invG,(d2*3/4), dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni = pEnd
pEnd = Point3d((-((L-d2)/2) + 0.2 + dDeltaPosX)*invG, pIni:getY(), dZedWork)
if H == dThickDoor and dEndPosY2 then
-- linea entrante inclinata
pIni2 = Point3d((((L-d2)/2) - 0.2 - dDeltaPosX)*invG, dIniPosY2,dZedWork)
pEnd2 = Point3d((((L-d2)/2) - 0.2)*invG, dPosY2,dZedWork)
DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
-- linea entrante in Y
pIni2 = pEnd2
pEnd2 = Point3d((((L-d2)/2) - 0.2)*invG, dEndPosY2,dZedWork)
DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linee tangente al percorso
pIni2 = pEnd2
pEnd2 = Point3d(((L-d2)/2)*invG, dEndPosY2,dZedWork)
DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
-- linea di uscita
pIni2 = pEnd2
pEnd2 = Point3d(((L-d2)/2)*invG,-(H+(d2*3/4)),dZedWork)
DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni2 = pEnd2
pEnd2 = Point3d((((L-d2)/2) - 0.2 - dDeltaPosX)*invG, pIni2:getY(), dZedWork)
end
else -- lead-in diritto
if H >= (d2*3/4) then
if (H-R) > (d2/4) then
dEndPosY = -(d2/4)
dEndPosY2 = -(H-(d2/4))
else
dEndPosY = -(H-R)
end
else
dEndPosY = -H+(d2/2)
end
dIniPosY = (d2*3/4)
dIniPosY2 = -(H+(d2*3/4))
pIni = Point3d((-((L-d2)/2) + 0.2)*invG, dIniPosY, dZedWork)
pEnd = Point3d((-((L-d2)/2) + 0.2)*invG, dEndPosY, dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
-- faccio il ritorno alla posizione di partenza
pIni = pEnd
pEnd = Point3d(-((L-d2)/2)*invG, dEndPosY, dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni = pEnd
pEnd = Point3d( pIni:getX(), dIniPosY, dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni = pEnd
pEnd = Point3d((-((L-d2)/2) + 0.2)*invG, pIni:getY(), dZedWork)
if H == dThickDoor and dEndPosY2 then
pIni2 = Point3d((((L-d2)/2) - 0.2)*invG, dIniPosY2, dZedWork)
pEnd2 = Point3d((((L-d2)/2) - 0.2)*invG, dEndPosY2, dZedWork)
DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), true, true, ORANGE(), ORANGE())
-- faccio il ritorno alla posizione di partenza
pIni2 = pEnd2
pEnd2 = Point3d(((L-d2)/2)*invG, dEndPosY2, dZedWork)
DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni2 = pEnd2
pEnd2 = Point3d( pIni2:getX(), dIniPosY2, dZedWork)
DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), false, true, ORANGE(), ORANGE())
pIni2 = pEnd2
pEnd2 = Point3d((((L-d2)/2) - 0.2)*invG, pIni2:getY(), dZedWork)
end
end
nPass = nPass + 1
dZedStart = dZedWork
-- se ho altri passi scendo in z
if nPass <= nStep then
local pIniLoc = pEnd
pEnd = Point3d(pIniLoc:getX(), pIniLoc:getY(), (dZedStart - dStep))
_, nConEnt, sKindVar = DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocketAs, bPreview, Dm, (d2/2), false, true,
ORANGE(), ORANGE(), sMaxFeed)
table.insert( tMVar, {nConEnt,sKindVar})
if H == dThickDoor then
pIniLoc = pEnd2
pEnd2 = Point3d(pIniLoc:getX(), pIniLoc:getY(), (dZedStart - dStep))
_, nConEnt, sKindVar = DrawAddLineDrawCircle( pIni2, pEnd2, Lg, tPocketAs2, bPreview, Dm, (d2/2), false, true,
ORANGE(), ORANGE(), sMaxFeed)
table.insert( tMVar2, {nConEnt,sKindVar})
end
end
end -- end while
-- trasformo in geometria composita
if ( #tPocketAs > 0) then
hintAs1 = EgtCurveCompo( Lg, tPocketAs, true)
if hintAs1 then
if nStep == 1 then
EgtModifyCurveThickness(hintAs1, -T)
else
EgtModifyCurveThickness( hintAs1, 0)
-- assegno nota con la lista delle entità di variazione
local sListEnt = ''
for i = 1, #tMVar do
sListEnt = sListEnt .. '{ ent=' .. EgtNumToString( tMVar[i][1], 0) .. ', ' .. 'code=' .. tMVar[i][2] .. '}'
if i < #tMVar then
sListEnt = sListEnt .. ','
end
end -- end for
if string.len( sListEnt) > 0 then EgtSetInfo( hintAs1, 'MVar', sListEnt) end
end
EgtSetName(hintAs1,LA)
end
end
if ( #tPocketAs2 > 0) then
hintAs2 = EgtCurveCompo( Lg, tPocketAs2, true)
if hintAs2 then
if nStep == 1 then
EgtModifyCurveThickness(hintAs2, -T)
else
EgtModifyCurveThickness( hintAs2, 0)
-- assegno nota con la lista delle entità di variazione
local sListEnt = ''
for i = 1, #tMVar2 do
sListEnt = sListEnt .. '{ ent=' .. EgtNumToString( tMVar2[i][1], 0) .. ', ' .. 'code=' .. tMVar2[i][2] .. '}'
if i < #tMVar2 then
sListEnt = sListEnt .. ','
end
end -- end for
if string.len( sListEnt) > 0 then EgtSetInfo( hintAs2, 'MVar', sListEnt) end
end
EgtSetName(hintAs2,LA)
end
end
end
---------------------------------------
-- geometria svuotatura giro esterno
---------------------------------------
if not est then -- se non c'è lavorazione steel
local tPocket = {}
local tMVar = {}
local nConEnt
local sKindVar
nPass = 1
dZedStart = 0
nStep = ceil(T/sf) -- numero di passate
dStep = (T/nStep) -- passo ricalcolato
while nPass <= nStep do
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T
end
if bStartOppo then
pIni = Point3d((-((L-d)/2) + 0.2)*invG,(d*3/4),dZedWork)
pStartStep = pIni -- memorizzo punto per ritorno e reiniziare nuovo step
-- linea in Y con centro utensile fuori
pEnd = Point3d((-((L-d)/2) + 0.2)*invG,dExtraH,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), true, true, RED(), RED())
-- linea traversa in X per andare sul vecchio punto iniziale (in X)
pIni = pEnd
pEnd = Point3d(((L-d)/2)*invG,dExtraH,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
pIni = pEnd
else
pIni = Point3d(((L-d)/2)*invG,(d*3/4),dZedWork)
pStartStep = pIni -- memorizzo punto per ritorno e reiniziare nuovo step
end
local bDrawCircle = EgtIf( bStartOppo, false, true)
if ( H <= (d/2) or ( L <= (d*2))) then -- se cava troppo bassa o stretta
-- linea entrante in Y
pEnd = Point3d(((L-d)/2)*invG,-H+(d/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), bDrawCircle, true, RED(), RED())
-- linea traversa in X
pIni = pEnd
pEnd = Point3d(-((L-d)/2)*invG,-H+(d/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
-- linea di risalita in Y
pIni = pEnd
pEnd = Point3d(-((L-d)/2)*invG,(d*3/4),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
pIni = pEnd
else
if H == dThickDoor then
pEnd = Point3d(((L-d)/2)*invG,-H-dExtraH,dZedWork)
else
if R > (d/2) then
pEnd = Point3d(((L-d)/2)*invG,(-H+R),dZedWork)
else
pEnd = Point3d(((L-d)/2)*invG,-H+(d/2),dZedWork)
end
end
-- linea entrante in Y
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), bDrawCircle, true, RED(), RED())
pIni = pEnd
if H == dThickDoor then
pEnd = Point3d(-((L-d)/2)*invG,-H-dExtraH,dZedWork)
else
if R > (d/2) then
-- raccordo 1
pEnd = Point3d(((L/2)-R)*invG,-H+(d/2),dZedWork)
pCen = Point3d(((L/2)-R)*invG,(-H+R),dZedWork)
DrawAddCircleDrawCircle( pCen, (R-(d/2)), EgtIf( invG > 0,0,180),-90*invG, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
pIni = pEnd
pEnd = Point3d(-((L/2)-R)*invG,-H+(d/2),dZedWork)
else
pEnd = Point3d(-((L-d)/2)*invG,-H+(d/2),dZedWork)
end
end
-- linea traversa in X
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
pIni = pEnd
if R > (d/2) then
-- raccordo 2
pEnd = Point3d(-((L-d)/2)*invG,(-H+R),dZedWork)
pCen = Point3d(-((L/2)-R)*invG,(-H+R),dZedWork)
DrawAddCircleDrawCircle( pCen, (R-(d/2)), -90,-90*invG, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
pIni = pEnd
end
-- linea di risalita in Y
pEnd = Point3d(-((L-d)/2)*invG,dExtraH,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, RED(), RED())
pIni = pEnd
-- linea di riposizionamento in X
if bStartOppo then
pEnd = Point3d(-(((L*2)-(d*3))/4)*invG,dExtraH,dZedWork)
else
pEnd = Point3d((((L*2)-(d*3))/4)*invG,dExtraH,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
pIni = pEnd
local nDirVers = EgtIf( bStartOppo, 1, -1)
local nDistYcentr = (d*p)
local nPosYcentr = nDistYcentr - dExtraH
local bContinue
local nDeltaXPk = 0
if H == dThickDoor then
bContinue = nPosYcentr < H
else
bContinue = nPosYcentr < ( H -(d/2))
end
-- se c'è il raggio e la coordinata Y è entrata nell'influenza del raccordo ne calcolo il delta in x
if bContinue and R > (d/2) and nPosYcentr > (H-R) then
local nDeltaY = nPosYcentr - (H-R)
nDeltaXPk = (R-(d/2)) - sqrt( ((R-(d/2))*(R-(d/2))) - (nDeltaY*nDeltaY))
end
-- ciclo passate svuotatura
while bContinue do
pEnd = Point3d((-nDirVers * ((((L*2)-(d*3))/4)-nDeltaXPk)*invG),-nPosYcentr,dZedWork)
-- linea affondamento in Y
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
pIni = pEnd
-- linea passata in X
pEnd = Point3d((nDirVers * ((((L*2)-(d*3))/4)-nDeltaXPk)*invG),-nPosYcentr,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
-- calcolo nuovo passo in Y e indice direzione
nPosYcentr = nPosYcentr + nDistYcentr
if H == dThickDoor then
bContinue = nPosYcentr < H
else
bContinue = nPosYcentr < ( H -(d/2))
end
-- calcolo il delta x relativo alla presenza del raccordo
if bContinue and R > (d/2) and nPosYcentr > (H-R) then
local nDeltaY = nPosYcentr - (H-R)
nDeltaXPk = (R-(d/2)) - sqrt( ((R-(d/2))*(R-(d/2))) - (nDeltaY*nDeltaY))
end
-- calcolo prossimo punto solo se sono ancora dentro l'area
if bContinue then
nDirVers = -nDirVers
-- ricalcolo punti per linea successiva
pIni = pEnd
end
end -- end while
-- se più passi o non ho concatenamenti seguenti, aggiungo linea di risalita in Y
if ( nStep > 1 and (nPass + 1) <= nStep) or not jn then
pIni = pEnd
pEnd = Point3d(pIni:getX(), (d*3/4), dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW()) -- linea di ritorno in Y
end
end
nPass = nPass + 1
dZedStart = dZedWork
-- se ho altri passi torno al punto di inizio
if nPass <= nStep then
pIni = pEnd
pEnd = Point3d(pStartStep:getX(),pStartStep:getY(),(dZedStart - dStep))
_, nConEnt, sKindVar = DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true,
YELLOW(), YELLOW(), sMaxFeed)
table.insert( tMVar, {nConEnt,sKindVar})
end
end -- end while
if jn then -- se uso un solo utensile mi porto in posizione di partenza per la prossima geometria
-- carcolo in che caso sono con la prossima geometria
if abs(H2-d) < 0.03 then -- solo 1 passaggio in centro
nCaseNext = 1
else
nCaseNext = 0
end
pIni = pEnd
if ( nCaseNext == 1) then -- se solo passaggio in centro parto dalla parte opposta
pEnd = Point3d(((-((L2-d)/2)*invG)+D_X),-(D+(H2/2)),dZedWork)
else
pEnd = Point3d(((((L2-d)/2)*invG)+D_X),-(D+(d/2)),dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- trasformo in geometria composita
if ( #tPocket > 0) then
hintPk = EgtCurveCompo( Lg, tPocket, true)
if hintPk then
EgtModifyCurveThickness(hintPk, 0)
if sf < T then -- se passi multipli
-- assegno nota con la lista delle entità di variazione
local sListEnt = ''
for i = 1, #tMVar do
sListEnt = sListEnt .. '{ ent=' .. EgtNumToString( tMVar[i][1], 0) .. ', ' .. 'code=' .. tMVar[i][2] .. '}'
if i < #tMVar then
sListEnt = sListEnt .. ','
end
end -- end for
if string.len( sListEnt) > 0 then EgtSetInfo( hintPk, 'MVar', sListEnt) end
end
EgtSetName(hintPk,LM)
end
end
end
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if hint then
EgtSetColor(hint,AQUA())
end
if hintAs1 then
EgtSetColor(hintAs1,AQUA())
end
if hintAs2 then
EgtSetColor(hintAs2,AQUA())
end
if hintPk then
EgtSetColor(hintPk,AQUA())
end
else
if hint then
EgtSetColor(hint,ORANGE())
end
if hintAs1 then
EgtSetColor(hintAs1,ORANGE())
end
if hintAs2 then
EgtSetColor(hintAs2,ORANGE())
end
if hintPk then
EgtSetColor(hintPk,ORANGE())
end
end
else -- altrimenti non Preview
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase(Dm)
end
-- assegno nota su percorsi antisplint e svuotatura
if hintAs1 then
EgtSetInfo( hintAs1, 'NotCheckDir', '1')
end
if hintAs2 then
EgtSetInfo( hintAs2, 'NotCheckDir', '1')
end
if hintPk then
EgtSetInfo( hintPk, 'NotCheckDir', '1')
end
end
return hint, hintPk, hintAs1, hintAs2
end
return LatchStrike
+1294
View File
File diff suppressed because it is too large Load Diff
+954
View File
@@ -0,0 +1,954 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- _MortiseCorner.lua by EgalWare s.r.l. 2016.06.14
-- Autore: Filippo Monchi
-- Mortise, componente di secondo livello, non può essere chiamato direttamente da un lua dei
-- componenti di interfaccia
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2024.07.19 V2.001 FM Set note 'NotCheckDir' to pocketing paths
-- Tavola per definizione modulo (serve ma non usata)
local _MortiseCorner = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
-- EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
-- Valori limite
local dExtraH = 0.5
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc, nRad, bDrawFirst, bDrawLast, cColor1, cColor2)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
if idTable then
table.insert( idTable, nLine)
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor(nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor(nCircle2, cColor2)
end
end
return nLine
end
-- Funzione di disegno
function _MortiseCorner.Draw( EC, EM, tMortiseParam, bPreview, bRunByCompo, nDrawMach, Pz, Lg, dThickDoor)
-- Assegno le dimensioni
local T = tMortiseParam.T
local L2 = tMortiseParam.L2
local H2 = tMortiseParam.H2
local T2 = tMortiseParam.T2
local s = tMortiseParam.s
local d = tMortiseParam.d
local p = tMortiseParam.p
local jn = tMortiseParam.jn
local d2 = tMortiseParam.d3
local p2 = tMortiseParam.p3
local invG = tMortiseParam.invG
local mkrev = tMortiseParam.mkrev
local jne = tMortiseParam.jne
local L3 = tMortiseParam.L3
local H3 = tMortiseParam.H3
local D_X = tMortiseParam.D_X
local pbs = tMortiseParam.pbs
-- Assegno i nomi dei layer
local LGM = tMortiseParam.LGM
local LMM = tMortiseParam.LMM
local DM = 'DUMMY'
-- variabili per messaggi e settaggi vari
local sCompoName = tMortiseParam.Nome
-- RunByComponetInterface
local RC = true
-- Variabili per risalita distaccata
local nDeltaMovX = 2
local nDeltaMovY = 2
if not bRunByCompo then
RC = false
end
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
-- Layer
local Dm
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName(Lg,sCompoName)
end
if nDrawMach > 0 then -- se abilitata geometria lavorazione
Dm = EgtGroup(Pz,GDB_RT.LOC) -- layer disegni cerchi rappresentatte il diametro utensile
EgtSetName(Dm,DM)
end
local hint1, hint2, hint3, hint4, hint5
local hint_2, hintPk2, hintPk2_r
if nDrawMach ~= 1 then -- se abilitata geometria esterna
-- Costruzione della geometria cerniera secondaria
hint1 = DrawAddLineDrawCircle( Point3d(-L2/2,0,0), Point3d(-L2/2,H2/2,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint2 = DrawAddLineDrawCircle( Point3d(-L2/2,H2/2,0), Point3d(L2/2,H2/2,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint3 = DrawAddLineDrawCircle( Point3d(L2/2,H2/2,0), Point3d(L2/2,-H2/2,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint4 = DrawAddLineDrawCircle( Point3d(L2/2,-H2/2,0), Point3d(-L2/2,-H2/2,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint5 = DrawAddLineDrawCircle( Point3d(-L2/2,-H2/2,0), Point3d(-L2/2,0,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint_2 = EgtCurveCompo( Lg, {hint1,hint2,hint3,hint4,hint5}, true)
EgtModifyCurveThickness(hint_2, -T2)
EgtSetName(hint_2,LGM)
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( hint_2, 'ProbeSide', '1')
end
end
---------------------------------------
---------------------------------------
-- Costruzione delle geometrie di lavorazione
---------------------------------------
---------------------------------------
if nDrawMach > 0 then -- se abilitata geometria lavorazione
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
local tPocket2 = {}
local tPocket2_r = {}
local pIni, pEnd
local pIni_r, pEnd_r
local pEnd2, pEnd2_r
local nCase
local nCaseNext
local dZedStart
local dZedWork
---------------------------------------
-- geometria svuotatura giro interno
---------------------------------------
local nStep
local dStep
local dPerim
local nDirVers
local nPass
if jn then -- svuotature unite calcolo il numero di passi in Z
-- individuo in che caso sono
if abs(H2-d) < 0.03 then -- solo 1 passaggio in centro
nCase = 1
elseif (H2-d) <= ( d*0.98) then -- solo passaggio di contornatura
nCase = 2
elseif ((H2-d) > ( d*0.98)) and ( (H2-d) <= (d*(1+p))) then -- passaggio di contornatura + un passaggio centrale
nCase = 3
elseif (H2-d) > (d*(1+p)) then -- passaggio di contornatura + passaggi zig zag
nCase = 4
end
dPerim = 2*( H2 + L2 -(d*3/2))+(d*3/2)
nStep = ceil((T2-T)/s) -- numero di passate
dStep = ((T2-T)/nStep) -- passo ricalcolato
dZedStart = -T
else -- svuotature separate ricalcolo i casi e il numero di passi in Z
-- individuo in che caso sono
if abs(H2-d2) < 0.03 then -- solo 1 passaggio in centro
nCase = 1
elseif (H2-d2) <= ( d2*0.98) then -- solo passaggio di contornatura
nCase = 2
elseif ((H2-d2) > ( d2*0.98)) and ( (H2-d2) <= (d2*(1+p2))) then -- passaggio di contornatura + un passaggio centrale
nCase = 3
elseif (H2-d2) > (d2*(1+p2)) then -- passaggio di contornatura + passaggi zig zag
nCase = 4
end
dPerim = 2*( H2 + L2 -(d2*3/2))+(d2*3/2)
nStep = ceil(T2/s) -- numero di passate
dStep = (T2/nStep) -- passo ricalcolato
dZedStart = 0
end
if jn then -- svuotature unite
if nCase == 1 then -- solo 1 passaggio in centro
nPass = 1
pEnd = Point3d(((L2-d)/2),0,dZedStart)
if mkrev then -- se abilitato anche il percorso inverso
pEnd_r = Point3d(((L2-d)/2),0,dZedStart)
end
while nPass <= nStep do
-- primo mezzo passo
pIni = pEnd
dZedWork = dZedStart - (dStep * ( nPass - 0.5))
pEnd = Point3d(-((L2/2)+dExtraH),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+dExtraH),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- secondo mezzo passo
pIni = pEnd
dZedWork = dZedStart - (dStep * nPass)
if nPass == nStep then
dZedWork = -T2
end
pEnd = Point3d(((L2-d)/2),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d)/2),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
nPass = nPass + 1
end
-- ultimo mezzo passo
pIni = pEnd
dZedWork = -T2
pEnd = Point3d(-((L2/2)+dExtraH),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+dExtraH),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
pIni = pEnd
-- Uscita in Z0
dZedWork = 0
pEnd = Point3d((-((L2/2)+dExtraH)-nDeltaMovX),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((-((L2/2)+dExtraH)-nDeltaMovX),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
end
-- solo contornatura or contornatura + un passaggio centrale or contornatura + passaggi svuotatura
elseif ( nCase == 2) or ( nCase == 3) or ( nCase == 4) then
nPass = 1
pEnd = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedStart)
if mkrev then -- se abilitato anche il percorso inverso
pEnd_r = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedStart)
end
while nPass <= nStep do
if nCase > 2 then -- se ho la svuotatura centrale scendo direttamente al passo
-- prima linea discendente
pIni = pEnd
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T2
end
pEnd = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
-- prima linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*((L2-(d/2)+(d*3/4))/dPerim))
end
pEnd = Point3d(((L2-d)/2),((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d)/2),-((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- seconda linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*((H2+L2-(d*3/2)+(d*3/4))/dPerim))
end
pEnd = Point3d(((L2-d)/2),-((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d)/2),((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- terza linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*(((2*L2)+H2-(2*d)+(2*(d*3/4)))/dPerim))
end
pEnd = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- quarta linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T2
end
end
if nCase == 3 then
pEnd = Point3d(-((L2/2)+(d*3/4)),0,dZedWork)
elseif nCase == 4 then
pEnd = Point3d(-((L2/2)+(d*3/4)),(((H2-d)/2)-(d2*p))*invG,dZedWork)
else
pEnd = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
if nCase == 3 then
pEnd_r = Point3d(-((L2/2)+(d*3/4)),0,dZedWork)
elseif nCase == 4 then
pEnd_r = Point3d(-((L2/2)+(d*3/4)),-(((H2-d)/2)-(d2*p))*invG,dZedWork)
else
pEnd_r = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedWork)
end
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- Se passaggio di contornatura e sono all'ultimo passo, faccio ancora un giro di contorno
if nCase == 2 and nPass == nStep then -- passaggio di contornatura
pIni = pEnd
pEnd = Point3d(((L2-d)/2),((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d)/2),-((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- seconda linea contorno
pIni = pEnd
pEnd = Point3d(((L2-d)/2),-((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d)/2),((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- terza linea contorno
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- quarta linea contorno
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedWork)
if ( nDeltaMovY > ((H2-d)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H2-d)/2
end
pEnd2 = Point3d((-((L2/2)+(d*3/4))-nDeltaMovX),(((H2-d)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedWork)
pEnd2_r = Point3d((-((L2/2)+(d*3/4))-nDeltaMovX),-(((H2-d)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
if nCase == 3 then -- passaggio di contornatura + un passaggio centrale
-- quinta linea passata centrale
pIni = pEnd
pEnd = Point3d((((L2*2)-(d*3))/4),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, LIME(), LIME())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((((L2*2)-(d*3))/4),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, LIME(), LIME())
end
-- sesta linea ritorno a posizione iniziale
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedWork)
if ( nDeltaMovY > ((H2-d)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H2-d)/2
end
pEnd2 = Point3d((-((L2/2)+(d*3/4))-nDeltaMovX),(((H2-d)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedWork)
pEnd2_r = Point3d((-((L2/2)+(d*3/4))-nDeltaMovX),-(((H2-d)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
elseif nCase == 4 then -- passaggio di contornatura + passaggi svuotatura
nDirVers = 1
local nDistYcentr = (d*p)
local nPosYcentr = ((H2-d)/2) - nDistYcentr
local bContinue = nPosYcentr > -((H2-d)/2)
local dXVal
local bNotFirst = false
-- linea posizionamento passaggi svuotatura
pIni = pEnd
pEnd = Point3d((-nDirVers * ((L2/2)+(d*3/4))),nPosYcentr*invG,dZedWork)
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((-nDirVers * ((L2/2)+(d*3/4))),-nPosYcentr*invG,dZedWork)
end
-- ciclo passate svuotatura
while bContinue do
if bNotFirst then -- non faccio il primo posizionamento perchè già posizionato nel giro esterno
-- linea affondamento in Y
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
if mkrev then -- se abilitato anche il percorso inverso
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
end
else
bNotFirst = true
end
-- linea passata in X
pIni = pEnd
if nDirVers > 0 then
dXVal = (((L2*2)-(d*3))/4)
else
dXVal = ((L2/2)+(d*3/4))
end
pEnd = Point3d((nDirVers * dXVal),nPosYcentr*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((nDirVers * dXVal),-nPosYcentr*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
end
-- calcolo nuovo passo in Y e indice direzione
nPosYcentr = nPosYcentr - nDistYcentr
bContinue = nPosYcentr > -((H2-d)/2)
-- calcolo prossimo punto solo se sono ancora dentro l'area
if bContinue then
-- ricalcolo punti per linea successiva
pIni = pEnd
if nDirVers > 0 then
dXVal = (((L2*2)-(d*3))/4)
else
dXVal = ((L2/2)+(d*3/4))
end
nDirVers = -nDirVers
pEnd = Point3d((-nDirVers * dXVal),nPosYcentr*invG,dZedWork)
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((-nDirVers * dXVal),-nPosYcentr*invG,dZedWork)
end
end
end
-- ultima linea ritorno a posizione iniziale
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d*3/4)),((H2-d)/2)*invG,dZedWork)
if ( nDeltaMovY > ((H2-d)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H2-d)/2
end
pEnd2 = Point3d((-((L2/2)+(d*3/4))-nDeltaMovX),(((H2-d)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d*3/4)),-((H2-d)/2)*invG,dZedWork)
pEnd2_r = Point3d((-((L2/2)+(d*3/4))-nDeltaMovX),-(((H2-d)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
nPass = nPass + 1
dZedStart = dZedStart - dStep
end
pIni = pEnd
-- Uscita in Z0
DrawAddLineDrawCircle( pIni, pEnd2, Lg, tPocket2, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
DrawAddLineDrawCircle( pIni_r, pEnd2_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
end
end
else -- svuotature separate
if nCase == 1 then -- solo 1 passaggio in centro
nPass = 1
dZedStart = 0
pEnd = Point3d(((L2-d2)/2),0,dZedStart) -- nuovo punto finale
hint3 = EgtCircle( Dm, pEnd, (d2/2) , GDB_RT.LOC)
EgtSetColor(hint3,PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pEnd_r = Point3d(((L2-d2)/2),0,dZedStart) -- nuovo punto finale
end
while nPass <= nStep do
-- primo mezzo passo
pIni = pEnd
dZedWork = dZedStart - (dStep * ( nPass - 0.5))
pEnd = Point3d(-((L2/2)+(d2*3/4)),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- secondo mezzo passo
pIni = pEnd
dZedWork = dZedStart - (dStep * nPass)
if nPass == nStep then
dZedWork = -T2
end
pEnd = Point3d(((L2-d2)/2),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d2)/2),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
nPass = nPass + 1
end
-- ultimo mezzo passo
pIni = pEnd
dZedWork = -T2
pEnd = Point3d(-((L2/2)+(d2*3/4)),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
pIni = pEnd
-- Uscita in Z0
dZedWork = 0
pEnd = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, GREEN(), GREEN())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
end
-- solo contornatura or contornatura + un passaggio centrale or contornatura + passaggi svuotatura
elseif ( nCase == 2) or ( nCase == 3) or ( nCase == 4) then
nPass = 1
dZedStart = 0
pEnd = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedStart) -- nuovo punto finale
hint3 = EgtCircle( Dm, pEnd, (d2/2) , GDB_RT.LOC)
EgtSetColor(hint3,PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedStart) -- nuovo punto finale
end
while nPass <= nStep do
if nCase > 2 then -- se ho la svuotatura centrale scendo direttamente al passo
-- prima linea discendente
pIni = pEnd
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T2
end
pEnd = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
-- prima linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*((L2-(d2/2)+(d2*3/4))/dPerim))
end
pEnd = Point3d(((L2-d2)/2),((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d2)/2),-((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- seconda linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*((H2+L2-(d2*3/2)+(d2*3/4))/dPerim))
end
pEnd = Point3d(((L2-d2)/2),-((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d2)/2),((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- terza linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*(((2*L2)+H2-(2*d2)+(2*(d2*3/4)))/dPerim))
end
pEnd = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- quarta linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T2
end
end
if nCase == 3 then
pEnd = Point3d(-((L2/2)+(d2*3/4)),0,dZedWork)
elseif nCase == 4 then
pEnd = Point3d(-((L2/2)+(d2*3/4)),(((H2-d2)/2)-(d2*p))*invG,dZedWork)
else
pEnd = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedWork)
end
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
if nCase == 3 then
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),0,dZedWork)
elseif nCase == 4 then
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),-(((H2-d2)/2)-(d2*p))*invG,dZedWork)
else
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedWork)
end
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- Se passaggio di contornatura e sono all'ultimo passo, faccio ancora un giro di contorno
if nCase == 2 and nPass == nStep then -- passaggio di contornatura
-- prima linea contorno
pIni = pEnd
pEnd = Point3d(((L2-d2)/2),((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d2)/2),-((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- seconda linea contorno
pIni = pEnd
pEnd = Point3d(((L2-d2)/2),-((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(((L2-d2)/2),((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- terza linea contorno
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- quarta linea contorno
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedWork)
if ( nDeltaMovY > ((H2-d2)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H2-d2)/2
end
pEnd2 = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),(((H2-d2)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedWork)
pEnd2_r = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),-(((H2-d2)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
if nCase == 3 then -- passaggio di contornatura + un passaggio centrale
-- quinta linea passata centrale
pIni = pEnd
pEnd = Point3d((((L2*2)-(d2*3))/4),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, LIME(), LIME())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((((L2*2)-(d2*3))/4),0,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, LIME(), LIME())
end
-- sesta linea ritorno a posizione iniziale
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedWork)
if ( nDeltaMovY > ((H2-d2)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H2-d2)/2
end
pEnd2 = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),(((H2-d2)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedWork)
pEnd2_r = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),-(((H2-d2)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
elseif nCase == 4 then -- passaggio di contornatura + passaggi svuotatura
nDirVers = 1
local nDistYcentr = (d2*p)
local nPosYcentr = ((H2-d2)/2) - nDistYcentr
local bContinue = nPosYcentr > -((H2-d2)/2)
local dXVal
local bNotFirst = false
-- linea posizionamento passaggi svuotatura
pIni = pEnd
pEnd = Point3d((-nDirVers * ((L2/2)+(d2*3/4))),nPosYcentr*invG,dZedWork)
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((-nDirVers * ((L2/2)+(d2*3/4))),-nPosYcentr*invG,dZedWork)
end
-- ciclo passate svuotatura
while bContinue do
if bNotFirst then -- non faccio il primo posizionamento perchè già posizionato nel giro esterno
-- linea affondamento in Y
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, YELLOW(), YELLOW())
if mkrev then -- se abilitato anche il percorso inverso
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
end
else
bNotFirst = true
end
-- linea passata in X
pIni = pEnd
if nDirVers > 0 then
dXVal = (((L2*2)-(d2*3))/4)
else
dXVal = ((L2/2)+(d2*3/4))
end
pEnd = Point3d((nDirVers * dXVal),nPosYcentr*invG,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, YELLOW(), YELLOW())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((nDirVers * dXVal),-nPosYcentr*invG,dZedWork)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
end
-- calcolo nuovo passo in Y e indice direzione
nPosYcentr = nPosYcentr - nDistYcentr
bContinue = nPosYcentr > -((H2-d2)/2)
-- calcolo prossimo punto solo se sono ancora dentro l'area
if bContinue then
-- ricalcolo punti per linea successiva
pIni = pEnd
if nDirVers > 0 then
dXVal = (((L2*2)-(d2*3))/4)
else
dXVal = ((L2/2)+(d2*3/4))
end
nDirVers = -nDirVers
pEnd = Point3d((-nDirVers * dXVal),nPosYcentr*invG,dZedWork)
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d((-nDirVers * dXVal),-nPosYcentr*invG,dZedWork)
end
end
end
-- ultima linea ritorno a posizione iniziale
pIni = pEnd
pEnd = Point3d(-((L2/2)+(d2*3/4)),((H2-d2)/2)*invG,dZedWork)
if ( nDeltaMovY > ((H2-d2)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H2-d2)/2
end
pEnd2 = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),(((H2-d2)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, PURPLE(), PURPLE())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
pEnd_r = Point3d(-((L2/2)+(d2*3/4)),-((H2-d2)/2)*invG,dZedWork)
pEnd2_r = Point3d((-((L2/2)+(d2*3/4))-nDeltaMovX),-(((H2-d2)/2)-nDeltaMovY)*invG,0)
DrawAddLineDrawCircle( pIni_r, pEnd_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
end
nPass = nPass + 1
dZedStart = dZedStart - dStep
end
pIni = pEnd
-- Uscita in Z0
DrawAddLineDrawCircle( pIni, pEnd2, Lg, tPocket2, bPreview, Dm, (d2/2), false, true, GREEN(), GREEN())
if mkrev then -- se abilitato anche il percorso inverso
pIni_r = pEnd_r
DrawAddLineDrawCircle( pIni_r, pEnd2_r, Lg, tPocket2_r, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
end
end
end
-- trasformo in geometria composita i/il percorsi/o di svuotatura
-- secondo percorso
if ( #tPocket2 > 0) then
hintPk2 = EgtCurveCompo( Lg, tPocket2, true)
if hintPk2 then
EgtModifyCurveThickness(hintPk2, 0)
EgtMove( hintPk2, Point3d(L2/2,0,0) - ORIG())
EgtSetName(hintPk2,LMM)
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( hintPk2, 'ProbeSide', '1')
end
end
end
if ( #tPocket2_r > 0) then
hintPk2_r = EgtCurveCompo( Lg, tPocket2_r, true)
if hintPk2_r then
EgtModifyCurveThickness(hintPk2_r, 0)
EgtMove( hintPk2_r, Point3d(L2/2,0,0) - ORIG())
EgtSetName(hintPk2_r,(LMM..'_R'))
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( hintPk2_r, 'ProbeSide', '1')
end
end
end
end
if hint_2 then
EgtMove( hint_2, Point3d(L2/2,0,0) - ORIG())
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if hint_2 then
EgtSetColor(hint_2,AQUA())
end
if hintPk2 then
EgtSetColor(hintPk2,AQUA())
end
if hintPk2_r then
EgtSetColor(hintPk2_r,AQUA())
end
else
if hint_2 then
EgtSetColor(hint_2,ORANGE())
end
if hintPk2 then
EgtSetColor(hintPk2,ORANGE())
end
if hintPk2_r then
EgtSetColor(hintPk2_r,ORANGE())
end
end
else -- altrimenti non Preview
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase( Dm)
end
-- assegno nota su percorsi svuotatura
if hintPk2 then
EgtSetInfo( hintPk2, 'NotCheckDir', '1')
end
if hintPk2_r then
EgtSetInfo( hintPk2_r, 'NotCheckDir', '1')
end
end
return hint_2, hintPk2, hintPk2_r
end
return _MortiseCorner
+3528
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+484
View File
@@ -0,0 +1,484 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- _OverHeadPocket.lua by EgalWare s.r.l. 2016.06.30
-- Autore: Filippo Monchi
-- Over Head Arm dati i valori 'L' e 'H' e 'T' e 'd' e 'p' e 'DS' e con nomi attributi
-- 2016.09.21 V1.001 FM Add warning messages
-- 2019.10.18 V2.000 FM Manage use Materials
-- 2020.05.25 V2.001 FM Manage geometries for calculate region when frame(jamb) is disposed on wide side
-- 2021.11.24 V2.002 FM Manage side probe option if variable DGC.Pms > 2
-- 2021.11.24 V2.003 FM Manage side probe option if variable DGC.Pms > 2
-- 2022.07.27 V2.004 FM Modification to use compiled code
-- 2024.07.19 V2.005 FM Set note 'NotCheckDir' to pocketing path
-- Tavola per definizione modulo (serve ma non usata)
local _OverHeadPocket = {}
-- Intestazioni
require( 'EgtBase')
EgtEnableDebug( false)
-- per messaggi
-- EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua')
-- EgtAddToPackagePath( DGD.BASEDIR .. '?.lua')
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev,
nGroupCirc, nRad, bDrawFirst, bDrawLast, cColor1, cColor2)
local nLine = EgtLine(nGroup, pInitial, pFinal, GDB_RT.LOC)
if idTable then
table.insert( idTable, nLine)
end
if bPrev then
if bDrawFirst then
local nCircle1 = EgtCircle( nGroupCirc, pInitial, nRad , GDB_RT.LOC)
EgtSetColor( nCircle1, cColor1)
end
if bDrawLast then
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , GDB_RT.LOC)
EgtSetColor( nCircle2, cColor2)
end
end
return nLine
end
-- Funzione di disegno
function _OverHeadPocket.Draw( EC, EM, tOHPkt, bPreview, bRunByCompo, nDrawMach, Pz, Lg)
-- Assegno le dimensioni
local L = tOHPkt.L2
local H = tOHPkt.H2
local T = tOHPkt.T2
local d = tOHPkt.d3
local p = tOHPkt.p3
local s = tOHPkt.s
local DS = tOHPkt.DS2
local kbs = tOHPkt.kbs -- keep backset/thickness (0: none, 1: only face, 2: all)
local pbs = tOHPkt.pbs
local dws = tOHPkt.Dws
-- Assegno i nomi geometrie
local LG = tOHPkt.LGM
local LM = tOHPkt.LMM
local DM = 'DUMMY'
-- variabili per messaggi e settaggi vari
local sCompoName = tOHPkt.Nome
-- RunByComponetInterface
local RC = true
-- Variabili per risalita distaccata
local nDeltaMovX = 2
local nDeltaMovY = 2
if not bRunByCompo then -- controllo se lanciato da componente
RC = false
end
-- 0 solo geom esterna, 1 solo geom mach, 2 entrambe
if not nDrawMach then -- se non definita la setto per non creare geometria di lavorazione
nDrawMach = 0
end
-- set variabili per compatibilità con vecchi componenti
-- step face: per compatibilità con tutti i componenti, se non è definito lo setto = alla profondità cava
if not s or abs(s) <= GEO.EPS_SMALL then
s = T
end
-- Layer
local Dm, Dor
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer della figura principale
EgtSetName( Lg, sCompoName)
end
if nDrawMach > 0 then -- se abilitata geometria lavorazione
Dm = EgtGroup( Pz, GDB_RT.LOC) -- layer disegni cerchi rappresentatte il diametro utensile
EgtSetName( Dm, DM)
Dor = EgtGroup( Pz, GDB_RT.LOC) -- layer disegni cerchi rappresentatte l'origine
EgtSetName( Dor, DM)
end
local hint1, hint2, hint3, hint4, hint5, hint6, hint, hintPk
-- disegno cerchio origine
if Dor then
local nCircleOri = EgtCircle( Dor, Point3d(0,0,0), d/4 , GDB_RT.LOC)
EgtSetColor( nCircleOri, NAVY())
end
if nDrawMach ~= 1 then -- se abilitata geometria esterna
hint1 = DrawAddLineDrawCircle( Point3d(0,H/2,0), Point3d(L/2,H/2,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint2 = DrawAddLineDrawCircle( Point3d(L/2,H/2,0), Point3d(L/2,-(H/2),0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint3 = DrawAddLineDrawCircle( Point3d(L/2,-(H/2),0), Point3d(-L/2,-(H/2),0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint4 = DrawAddLineDrawCircle( Point3d(-L/2,-(H/2),0), Point3d(-L/2,H/2,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint5 = DrawAddLineDrawCircle( Point3d(-L/2,H/2,0), Point3d(0,H/2,0), Lg, nil, bPreview, Dm, 0, false, false, RED(), RED())
hint = EgtCurveCompo( Lg, {hint1,hint2,hint3,hint4,hint5}, true)
if hint then
EgtModifyCurveThickness(hint, -T)
EgtSetName(hint,LG)
-- muovo la geometria vesro sinistra del valore di L/2 + DS
EgtMove( hint, Point3d(-((L/2)+DS),0,0) - ORIG())
EgtSetInfo( hint,'InserPoint' ,'Center') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo( hint,'DeltaPos' ,( L+(2*DS)))
-- se mantiene centro spessore anche su face
if kbs and kbs > 0 then
EgtSetInfo( hint, 'KeepBackSet', 'c') -- setto 'c' perchè viene mantenuto il centro spessore
end
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( hint, 'ProbeSide', '1')
end
end
end
---------------------------------------
---------------------------------------
-- Costruzione delle geometrie di lavorazione
---------------------------------------
---------------------------------------
if nDrawMach > 0 then -- se abilitata geometria lavorazione
if not Lg then
Lg = EgtGroup(Pz,GDB_RT.LOC)
EgtSetName(Lg,sCompoName)
end
---------------------------------------
-- geometria svuotatura giro interno
---------------------------------------
local tPocket = {}
local pIni
local pEnd
local pEnd2
local nStep
local dStep
local dPerim
local nDirVers
local nPass
local dZedStart = 0
local dZedWork = -T
-- individuo in che caso sono
local nCase
if abs(H-d) < 0.03 then -- solo 1 passaggio in centro
nCase = 1
elseif (H-d) <= ( d*0.98) then -- solo passaggio di contornatura
nCase = 2
elseif ((H-d) > ( d*0.98)) and ( (H-d) <= (d*(1+p))) then -- passaggio di contornatura + un passaggio centrale
nCase = 3
elseif (H-d) > (d*(1+p)) then -- passaggio di contornatura + passaggi zig zag
nCase = 4
end
dPerim = 2*( H + L -(2*d))
nStep = ceil(T/s) -- numero di passate
dStep = (T/nStep) -- passo ricalcolato
if nCase == 1 then -- solo 1 passaggio in centro
nPass = 1
nDirVers = 1
dZedStart = 0
pEnd = Point3d((-nDirVers*((L-d)/2)),0,dZedStart) -- nuovo punto finale
hint3 = EgtCircle( Dm, pEnd, (d/2) , GDB_RT.LOC)
EgtSetColor(hint3,PURPLE())
local nDoubleStep = nStep * 2
while nPass <= nDoubleStep do
-- primo mezzo passo
nDirVers = - nDirVers
pIni = pEnd
dZedWork = dZedStart - ((dStep * nPass)/2)
if nPass == nDoubleStep then
dZedWork = -T
end
pEnd = Point3d((-nDirVers*((L-d)/2)),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
nPass = nPass + 1
end
-- ultimo mezzo passo
nDirVers = - nDirVers
pIni = pEnd
dZedWork = -T
pEnd = Point3d((-nDirVers*((L-d)/2)),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- Uscita in Z0
pIni = pEnd
dZedWork = 0
if ( nDeltaMovX > (L-d)) then
nDeltaMovX = (L-d)
end
pEnd = Point3d((-nDirVers*((L-d)/2)-nDeltaMovX),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
-- solo contornatura or contornatura + un passaggio centrale or contornatura + passaggi svuotatura
elseif ( nCase == 2) or ( nCase == 3) or ( nCase == 4) then
nPass = 1
nDirVers = 1
dZedStart = 0
pEnd = Point3d(((L-d)/2),((H-d)/2),dZedStart) -- nuovo punto finale
hint3 = EgtCircle( Dm, pEnd, (d/2) , GDB_RT.LOC)
EgtSetColor(hint3,PURPLE())
while nPass <= nStep do
if nCase > 2 then -- se ho la svuotatura centrale scendo direttamente al passo
-- prima linea discendente
pIni = pEnd
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T
end
pEnd = Point3d(((L-d)/2),((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
-- prima linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*((H-d)/dPerim))
end
pEnd = Point3d(((L-d)/2),-((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- seconda linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*((H+L-(2*d))/dPerim))
end
pEnd = Point3d(-((L-d)/2),-((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- terza linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - ( dStep*(((2*H)+L-(3*d))/dPerim))
end
pEnd = Point3d(-((L-d)/2),((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- quarta linea contorno
pIni = pEnd
if nCase == 2 then
dZedWork = dZedStart - dStep
if nPass == nStep then
dZedWork = -T
end
end
pEnd = Point3d(((L-d)/2),((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- Se passaggio di contornatura e sono all'ultimo passo, faccio ancora un giro di contorno
if nCase == 2 and nPass == nStep then -- passaggio di contornatura
-- prima linea contorno
pIni = pEnd
pEnd = Point3d(((L-d)/2),-((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- seconda linea contorno
pIni = pEnd
pEnd = Point3d(-((L-d)/2),-((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- terza linea contorno
pIni = pEnd
pEnd = Point3d(-((L-d)/2),((H-d)/2),dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
-- quarta linea contorno
pIni = pEnd
pEnd = Point3d(((L-d)/2),((H-d)/2),dZedWork)
if ( nDeltaMovX > ((L-d)/2)) then -- se delta più grande di metà cava in X
nDeltaMovX = (L-d)/2
end
if ( nDeltaMovY > ((H-d)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H-d)/2
end
pEnd2 = Point3d((((L-d)/2)-nDeltaMovX),(((H-d)/2)-nDeltaMovY),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
if nCase == 3 then -- passaggio di contornatura + un passaggio centrale
-- quinta linea posizionamento passata centrale
pIni = pEnd
pEnd = Point3d((((L*2)-(d*3))/4),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, LIME(), LIME())
-- sesta linea passata centrale
pIni = pEnd
pEnd = Point3d(-(((L*2)-(d*3))/4),0,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, LIME(), LIME())
-- settima linea ritorno a posizione iniziale
pIni = pEnd
pEnd = Point3d(((L-d)/2),((H-d)/2),dZedWork)
if ( nDeltaMovX > ((L-d)/2)) then -- se delta più grande di metà cava in X
nDeltaMovX = (L-d)/2
end
if ( nDeltaMovY > ((H-d)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H-d)/2
end
pEnd2 = Point3d((((L-d)/2)-nDeltaMovX),(((H-d)/2)-nDeltaMovY),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
elseif nCase == 4 then -- passaggio di contornatura + passaggi svuotatura
nDirVers = -1
local nDistYcentr = (d*p)
local nPosYcentr = ((H-d)/2) - nDistYcentr
local bContinue = nPosYcentr > -((H-d)/2)
-- linea posizionamento passaggi svuotatura
pIni = pEnd
pEnd = Point3d((-nDirVers * (((L*2)-(d*3))/4)),nPosYcentr,dZedWork)
-- ciclo passate svuotatura
while bContinue do
-- linea affondamento in Y
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
-- linea passata in X
pIni = pEnd
pEnd = Point3d((nDirVers * (((L*2)-(d*3))/4)),nPosYcentr,dZedWork)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, YELLOW(), YELLOW())
-- calcolo nuovo passo in Y e indice direzione
nPosYcentr = nPosYcentr - nDistYcentr
bContinue = nPosYcentr > -((H-d)/2)
-- calcolo prossimo punto solo se sono ancora dentro l'area
if bContinue then
nDirVers = -nDirVers
-- ricalcolo punti per linea successiva
pIni = pEnd
pEnd = Point3d((-nDirVers * (((L*2)-(d*3))/4)),nPosYcentr,dZedWork)
end
end
-- ultima linea ritorno a posizione iniziale
pIni = pEnd
pEnd = Point3d(((L-d)/2),((H-d)/2),dZedWork)
if ( nDeltaMovX > ((L-d)/2)) then -- se delta più grande di metà cava in X
nDeltaMovX = (L-d)/2
end
if ( nDeltaMovY > ((H-d)/2)) then -- se delta più grande di metà cava in Y
nDeltaMovY = (H-d)/2
end
pEnd2 = Point3d((((L-d)/2)-nDeltaMovX),(((H-d)/2)-nDeltaMovY),0)
DrawAddLineDrawCircle( pIni, pEnd, Lg, tPocket, bPreview, Dm, (d/2), false, true, PURPLE(), PURPLE())
end
nPass = nPass + 1
dZedStart = dZedStart - dStep
end
-- Uscita in Z0
pIni = pEnd
DrawAddLineDrawCircle( pIni, pEnd2, Lg, tPocket, bPreview, Dm, (d/2), false, true, GREEN(), GREEN())
end
-- trasformo in geometria composita il percorso di svuotatura
if ( #tPocket > 0) then
hintPk = EgtCurveCompo( Lg, tPocket, true)
if hintPk then
EgtModifyCurveThickness(hintPk, 0)
EgtSetName(hintPk,LM)
-- muovo la geometria vesro sinistra del valore di L/2 + DS
EgtMove( hintPk, Point3d(-((L/2)+DS),0,0) - ORIG())
-- muovo la geometria vesro sinistra del valore di L/2 + DS
EgtMove( Dm, Point3d(-((L/2)+DS),0,0) - ORIG())
EgtSetInfo( hintPk,'InserPoint' ,'Center') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo( Dm,'InserPoint' ,'Center') -- setto una nota per indicare su che lato della porta deve essere spostato
EgtSetInfo( hintPk,'DeltaPos' ,( L+(2*DS)))
EgtSetInfo( Dm,'DeltaPos' ,( L+(2*DS)))
-- se mantiene centro spessore anche su mortise
if kbs and kbs > 0 then
EgtSetInfo( hintPk, 'KeepBackSet', 'c') -- setto 'c' perchè viene mantenuto il centro spessore
end
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
EgtSetInfo( hintPk, 'ProbeSide', '1')
end
end
end
if dws then -- se frame viene disposto sul lato wide
local nIdSideBoxUp
if hint then
nIdSideBoxUp = EgtCopyGlob( hint, Lg)
EgtSetName( nIdSideBoxUp, 'upper')
EgtSetInfo( nIdSideBoxUp, 'SideDoor', 'upper')
end
end
end
-- cambio colore alla geometria
if bPreview then
if EC == 0 then
if hint then
EgtSetColor(hint,AQUA())
end
if hintPk then
EgtSetColor(hintPk,AQUA())
end
else
if hint then
EgtSetColor(hint,ORANGE())
end
if hintPk then
EgtSetColor(hintPk,ORANGE())
end
end
else -- altrimenti non Preview
-- (NOTA : se ci sono errori il componente non viene eseguito dal programma di gestione dei componenti)
-- cancello le parti ausiliarie se disegnate
if Dm then
EgtErase(Dm)
end
if Dor then
EgtErase(Dor)
end
-- assegno nota su percorso svuotatura
if hintPk then
EgtSetInfo( hintPk, 'NotCheckDir', '1')
end
end
return hint, hintPk
end
return _OverHeadPocket
+1902
View File
File diff suppressed because it is too large Load Diff
+1549
View File
File diff suppressed because it is too large Load Diff
+560
View File
@@ -0,0 +1,560 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- Machining.lua by EgalWare s.r.l. 2016.23.05
-- Machining generation for Doors program
-- 2018.11.06 V1.001 FM Check bevel profiles on top and bottom door side
-- 2019.01.16 V1.002 FM fix error into FindGroupNameWithInfo
-- 2019.02.08 V2.001 FM Change release to 2 by new EgtCam5 Release
-- 2019.02.08 V2.002 FM Manage error in case Post processor (Machining_xx) file not defined
-- 2019.07.02 V2.003 FM Add at the end, library reset commands for DoorsLib and EgtDoorsBase
-- 2020.05.29 V2.004 FM Force single jambs dispsotion when material is aluminum
-- 2021.07.06 V2.005 FM Manage show error messages in case the mtable info not match with corrent EgtDoor configuration
-- 2021.07.06 V2.005 FM Manage show error messages in case run Dmach with empty piece or not saved piece
-- 2022.07.27 V2.006 FM Modification to use compiled code
-- 2024.07.24 V2.007 FM By CurrcamInfo parameter (MakeSentinelFileWhenNoMach) add to write sentinel file if there are not machining
-- 2024.10.15 V2.008 FM Manage better when there is no machining on a machine to crerate a right .tok file
-- 2024.11.20 V2.009 DS If Machining runs by DMACH set as current the 1st machining group
-- 2025.01.17 V2.00a FM Manage .ini parameter 'OptimizeMachForLine' to enable machining adjustment for line machines
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
if not _G.DGD then
_G.DGD = {}
end
-- Librerie particolari
local sBaseDir = DGD.BASEDIR -- EgtGetSourceDir()
EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
require( 'EgtDoorsBase')
require( 'EgtDoorsData')
local OptimizeMach = false
-----------------------------------------------------------------
-- *** Sentinel write file ***
-----------------------------------------------------------------
local function WriteSntFile( sFileErr, sDispMsg)
if sDispMsg and #sDispMsg > 0 then
local nIdFile = io.open( sFileErr, 'w')
if nIdFile then
nIdFile:write('\n' .. sDispMsg)
nIdFile:close()
end
end
end
local function FindGroupNameWithInfo( sGroupName, sNameInfo)
-- cerco il primo pezzo con il nome passato
local Pz = EgtGetFirstNameInGroup( GDB_ID.ROOT, sGroupName)
local Pzi = Pz
local sAssemblyName
local sDoorName
local bNotProduce
while Pz do
-- verifico se la nota di produzione è per non produrre il pezzo
bNotProduce = EgtGetInfo( Pz, 'Produce', 'i') == 0
-- cerco se il pezzo ha l'info desiderata
sAssemblyName = EgtGetInfo( Pz, 'Assembly')
if sAssemblyName and sAssemblyName == sNameInfo then
if bNotProduce then
return nil, nil
else
return Pz, sAssemblyName
end
elseif not sAssemblyName then -- se non ho un nome di assemblato
if bNotProduce then
return nil, nil
end
sDoorName = EgtGetInfo( Pz, 'N')
end
Pz = EgtGetNextName( Pz, sGroupName)
end
return Pz, sAssemblyName, Pzi, sDoorName
end
-- Librerie di lavorazione
EgtAddToPackagePath( sBaseDir .. '?.lua')
local EgtDoorsMsg = require( 'EgtDoorsMsg')
-- variabile presentazione dialogo
local bEnAssemblyDispos = false
-----------------------------------------------------------------------------------
-- se machining lanciato DMACH chiedo se si vuole la generazione o la disposizione
if not DGD.NCGEN then
-- se dialogo abilitato
if bEnAssemblyDispos then
local tsMode = EgtDialogBox( ' 0 = pieces disposition, 1 = machines pieces', {'Choice:', '1'})
local sMode = '1'
if tsMode then
sMode = tsMode[1]
end
-- se scelta di disposizione pezzi
if sMode == '0' then
local sPathAssemb = sBaseDir .. 'LuaLibs\\' .. 'Main_Assemb_I.lua'
local bOkDisp = dofile( sPathAssemb)
return bOkDisp
end
end
end
-- Librerie di lavorazione
EgtAddToPackagePath( sBaseDir .. 'MTables\\?.mtl')
require( 'CurrDoorsCustomData')
local MB = require( 'MachiningBase')
-- Reset dati custom
ResetDoorsCustomData()
-- nome componente machining di default
local sCompoMachining = 'Machining_1'
-- nome file dati cam
local sPathCurrMachtabOri = sBaseDir..'CurrCamInfo'..'.lua'
local mCamData
-- Project path, name, extension
local sFilePath = EgtGetCurrFilePath()
if not sFilePath then
EgtOutText( EgtDoorsMsg[694])
-- se machining lanciato DMACH visualizzo errore
if not DGD.NCGEN then
EgtOutBox( EgtDoorsMsg[694], EgtDoorsMsg[476], EgtDoorsMsg[477]) -- Error on Nc part program generation
end
return false
end
local sFileDir, sFileName, sFileExt = EgtSplitPath( sFilePath)
local sLogFile = sFileDir .. sFileName .. '.log'
-- se machining lanciato DMACH
if not DGD.NCGEN then
-- open log file in append
OpenLogFile(sLogFile, 'a')
end
-- ---------------------------------------------------------------------------------------------
-- verifico parametro ini per gestione ottimizzazione lavorazioni macchine in linea
-- ---------------------------------------------------------------------------------------------
-- ottengo il file ini dell'egtcam5
local sConfigFolder = EgtGetIniFile()
-- ottengo parametro
local nTemp = EgtGetNumberFromIni( 'DOORS', 'OptimizeMachForLine', 0, sConfigFolder)
OptimizeMach = EgtIf( nTemp > 0, true, false)
-- ---------------------------------------------------------------------------------------------
-- ---------------------------------------------------------------------------------------------
-- verifico se esiste il file
if EgtExistsFile( sPathCurrMachtabOri) then
-- utilizzo la tabella
sPathCurrMachtabOri = 'CurrCamInfo'
mCamData = require( sPathCurrMachtabOri)
else
DoorOutLog( string.format(EgtDoorsMsg[487], '', sPathCurrMachtabOri), 0) -- File non trovato
EgtOutText( string.format(EgtDoorsMsg[487], '', sPathCurrMachtabOri))
-- se machining lanciato DMACH chiudo file log
if not DGD.NCGEN then CloseLogFile() end
return false
end
-- Resetto i gruppi lavorazioni se esistono
local nMchId = EgtGetFirstMachGroup()
while nMchId do
EgtRemoveMachGroup( nMchId)
nMchId = EgtGetFirstMachGroup()
end
local bOk = false
-- nomi pezzi da cercare e nomi delle note per le porte
local sPieceName = 'DOO*'
local sFindNote = 'first'
local MachJambTogh = 0
local nLocNumGroup
-- variabile per lancio disposizione pezzi assemblato
local bFirstCheckDisp = true
local nIdProcessedPiece = 0
repeat -- ripeti per tutti i pezzi trovati
-- determino il pezzo dell'assemblato o pezzo unico
local Pz = {}
local Pz2 = {}
local tFoundAssembly = {}
local tFoundAssembly2 = {}
local sFoundAssembly
local sFoundDoor
local Pzi, Pii
-- ricavo id pezzo e se è assemblato
Pii, sFoundAssembly, Pzi, sFoundDoor = FindGroupNameWithInfo( sPieceName, sFindNote)
if sFoundAssembly then
table.insert( Pz, Pii)
else
if nIdProcessedPiece ~= Pzi then
nIdProcessedPiece = Pzi
table.insert( Pz, Pzi)
end
end
table.insert( tFoundAssembly, sFoundAssembly)
if #Pz > 0 then -- se il pezzo è valido
if bFirstCheckDisp and bEnAssemblyDispos then
local sPathAssemb = sBaseDir .. 'LuaLibs\\' .. 'Main_Assembly.lua'
local MHgen = require('Main_Assembly')
-- lancio funzione main del componente
bOk = MHgen.main(0) -- passo il parametro per disporre l'assemblato sul piano
bFirstCheckDisp = false
end
local MachiningsTable = EgtGetInfo( Pz[1], 'MTable')
local MachiningsPath = EgtGetInfo( Pz[1], 'MTablePath')
local sDoorMaterial = EgtGetInfo( Pz[1], 'Material')
local bAlumDoor = FindMaterial( sDoorMaterial, 'aluminum') -- per aluminum doors
-- se nome tabella non esiste esco subito
if not MachiningsTable then
DoorOutLog( EgtDoorsMsg[499], 0) -- Errore nel file cam
EgtOutText( EgtDoorsMsg[499])
-- se machining lanciato DMACH chiudo file log
if not DGD.NCGEN then CloseLogFile() end
return bOk
-- altrimenti controllo se esiste il file della mtable
else
local sMtableFile = sBaseDir .. 'MTables\\' .. MachiningsTable .. '.mtl'
if not EgtExistsFile( sMtableFile) then
DoorOutLog( string.format(EgtDoorsMsg[692], sMtableFile, sBaseDir), 0) -- Mtable non trovata
EgtOutText( string.format(EgtDoorsMsg[692], sMtableFile, sBaseDir))
-- se machining lanciato DMACH chiudo file log
if not DGD.NCGEN then
EgtOutBox( string.format(EgtDoorsMsg[692], sMtableFile, sBaseDir), EgtDoorsMsg[476], EgtDoorsMsg[477]) -- Error on Nc part program generation
CloseLogFile()
end
return bOk
end
-- verifico anche il percorso della Mtable se corrisponde
sMtableFile = sBaseDir .. 'MTables\\'
if string.lower(sMtableFile) ~= string.lower(MachiningsPath) then
DoorOutLog( string.format(EgtDoorsMsg[693], sMtableFile, sBaseDir), 0) -- percorso Mtable non corrispondente
EgtOutText( string.format(EgtDoorsMsg[693], sMtableFile, sBaseDir))
-- se machining lanciato DMACH chiudo file log
if not DGD.NCGEN then
EgtOutBox( string.format(EgtDoorsMsg[693], MachiningsPath, sMtableFile), EgtDoorsMsg[476], EgtDoorsMsg[477]) -- Error on Nc part program generation
CloseLogFile()
end
return bOk
end
end
local M = require( MachiningsTable)
local MachinesName = M.MMachineData
local MTablePrev = M.MTable
local nNumMach
local nNumGroup = 0
local tListCompo = {}
local nNoMach
-- per ogni macchina presente in MTable
for j = 1, #MachinesName do
-- inizializzo la variabile dei messaggi di errore
if not DGD.NCGEN then
DGD.ERR = nil
DGD.EMC = ''
DGD.ERM = ''
end
nNumMach = 0
MachJambTogh = 0
-- verifico se il nome macchina è presente nel file CurrCamInfo
-- e se c'è il parametro per lavorare i jamb assieme
for i = 1, #mCamData do
if string.lower( MachinesName[j].MachName) == string.lower(mCamData[i].MachName) then
nNumMach = i
if mCamData[i].MachineJambsTogether then
MachJambTogh = mCamData[i].MachineJambsTogether
end
end
end
-- se porta di alluminio per ora forzo la disposizione singola
if bAlumDoor then MachJambTogh = 0 end
-- abilitata lavorazione pezzi jamb assieme
if MachJambTogh == 1 then
-- se pezzo passato non è una porta cerco gli altri pezzi
if sPieceName ~= 'DOO*' then
-- carico tutti i pezzi frame nella tabella
while sFindNote ~= '' and sFindNote ~= 'framebot' do
-- se pezzo valido e non è una porta cerco il frame successivo al sinistro
if sFindNote == 'framesx' then
sFindNote = 'framedx'
sPieceName = 'FRAME*'
elseif sFindNote == 'framedx' then
sFindNote = 'frametop'
sPieceName = 'FRAME*'
elseif sFindNote == 'frametop' then
sFindNote = 'framebot'
sPieceName = 'FRAME*'
else
sFindNote = ''
end
if sFindNote ~= '' and sFindNote ~= 'framebot' then
Pii, sFoundAssembly, Pzi = FindGroupNameWithInfo( sPieceName, sFindNote)
if Pii then
table.insert( Pz, Pii)
table.insert( tFoundAssembly, sFoundAssembly)
end
elseif sFindNote == 'framebot' then -- il frame bottom lo faccio da solo
Pii, sFoundAssembly, Pzi = FindGroupNameWithInfo( sPieceName, sFindNote)
if Pii then
table.insert( Pz2, Pii)
table.insert( tFoundAssembly2, sFoundAssembly)
end
end
end
end
end
if nNumMach > 0 then
-- imposto i dati macchina secondo le informazioni del file cam
sCompoMachining = mCamData[nNumMach].CompoMachining
local MachName = mCamData[nNumMach].MachName
if sCompoMachining then
DoorOutLog( ' Postprocessor used: ' .. sCompoMachining, 0)
-- se ci sono lavorazioni nella Mtable per la macchina selezionata entro
-- MTable scanning
local sLocMachId
local bFoundmach = false
local bFoundmach2 = false
for k = 1, #MTablePrev do
if MTablePrev[k].On ~= 0 then -- se non è disabilitata
-- acquisisco numero macchine (se indicato), se non trovato setto macchina 1 ( per default nella Mtable)
sLocMachId = MTablePrev[k].MachId or 1
if sLocMachId == j then -- se numero macchina corrispondente
-- Recupero le entità
local EntList = {}
local EntList2 = {}
local sNameMach = MTablePrev[k].Name
local sNameMach2 = MTablePrev[k].Name
-- se metodo assegnato è bevel verifico che siano coerenti con la dsposizione finale
if MTablePrev[k].Oper and MTablePrev[k].Oper == 'AdjustBevel' then
EntList = MB.FindEntitiesWithName( Pz , sNameMach)
EntList2 = MB.FindEntitiesWithName( Pz2, sNameMach2)
if #EntList == 0 then -- se non trovata nessuna entità provo con l'opposta
local sTmpName = sNameMach
sNameMach = EgtIf( sNameMach == 'BU', 'BD','BU')
EntList = MB.FindEntitiesWithName( Pz, sNameMach)
if #EntList == 0 then -- se non trovata nessuna entità provo con quella di testa opposta
sNameMach = sTmpName
sNameMach = EgtIf( sNameMach == 'BU_H', 'BD_H','BU_H')
EntList = MB.FindEntitiesWithName( Pz, sNameMach)
end
end
if #EntList2 == 0 then -- se non trovata nessuna entità provo con l'opposta
local sTmpName2 = sNameMach2
sNameMach2 = EgtIf( sNameMach2 == 'BU', 'BD','BU')
EntList2 = MB.FindEntitiesWithName( Pz2, sNameMach2)
if #EntList2 == 0 then -- se non trovata nessuna entità provo con quella di testa opposta
sNameMach2 = sTmpName2
sNameMach2 = EgtIf( sNameMach2 == 'BU_H', 'BD_H','BU_H')
EntList2 = MB.FindEntitiesWithName( Pz2, sNameMach2)
end
end
-- se non ho metodi oppure se metodo non AdjustProbeMill o non AdjustProbeHole verifico se ho lavorazioni
elseif not MTablePrev[k].Oper or not ( MTablePrev[k].Oper == 'AdjustProbeMill' or MTablePrev[k].Oper == 'AdjustProbeHole') then
EntList = MB.FindEntitiesWithName( Pz , sNameMach)
EntList2 = MB.FindEntitiesWithName( Pz2, sNameMach2)
end
-- se trovate entità associate a nome lavorazione
if #EntList > 0 then
bFoundmach = true
end
if #EntList2 > 0 then
bFoundmach2 = true
end
-- siccome sono mutuamente esclusivi perchè il frame bottom (Pz2) è lavorato da solo
-- se una delle due è vera, ci sono delle lavorazioni per quel pezzo/i
if bFoundmach or bFoundmach2 then
break -- esco dal for appena ho trovato almeno una lavorazione
end
end
end
end
if bFoundmach or bFoundmach2 then -- se ho delle lavorazioni sul pezzo/i
-- metto in tabella il nome del componente lanciato per il forget
table.insert( tListCompo,sCompoMachining)
if nLocNumGroup and nLocNumGroup > 0 then nNumGroup = nLocNumGroup end
-- lancio il primo componente base
MHgen = require( sCompoMachining)
if bFoundmach then
bOk, nLocNumGroup, nNoMach = MHgen.Calc( Pz, tFoundAssembly, j, nNumMach, nNumGroup, OptimizeMach)
end
if bFoundmach2 then
bOk, nLocNumGroup, nNoMach = MHgen.Calc( Pz2, tFoundAssembly2, j, nNumMach, nNumGroup, OptimizeMach)
end
if nNoMach == 1 then
nLocNumGroup = nLocNumGroup - 1
end
else
nNoMach = 1
end
-- se non ho lavorazioni
if nNoMach == 1 then
local nPieceNum = EgtIf( #Pz == 1, Pz[1], 0)
if nPieceNum == 0 then
nPieceNum = EgtIf( #Pz2 == 1, Pz2[1], 0)
end
local sPieceName = EgtIf( #tFoundAssembly == 1, tFoundAssembly[1], '')
if #sPieceName < 1 then
sPieceName = EgtIf( #tFoundAssembly2 == 1, tFoundAssembly2[1], '')
end
if #sPieceName < 1 then
sPieceName = EgtIf( #sFoundDoor > 0, sFoundDoor, '')
end
DoorOutLog( string.format( EgtDoorsMsg[493], MachName, nPieceNum, sPieceName), 0) -- No machining for machine
if not DGD.NCGEN then
EgtOutBox( string.format(EgtDoorsMsg[493], MachName, nPieceNum, sPieceName), EgtDoorsMsg[501], EgtDoorsMsg[502])
end
-- CurrCamInfo option to generate sentinel file
local nGenSentinel = mCamData[nNumMach].MakeSentinelFileWhenNoMach or 0
if nGenSentinel == 1 then
if nLocNumGroup and nLocNumGroup > 0 then nNumGroup = nLocNumGroup end
-- incremento il numero del gruppo
nNumGroup = nNumGroup + 1
-- compongo il file sentinella (.tok)
local sNumGroup = EgtIf( nNumGroup > 1, '_' .. EgtNumToString( nNumGroup,0), '')
local sSentinelFileName = sFileDir..sFileName..sNumGroup..'.tok'
-- cancello il file tok
EgtEraseFile( sSentinelFileName)
WriteSntFile( sSentinelFileName, 'Err=0\n LIGHT=PURPLE\n \n No machining for this machine\n')
end
end
else
DoorOutLog( EgtDoorsMsg[640], 0)
if not DGD.NCGEN then
EgtOutBox( EgtDoorsMsg[640], EgtDoorsMsg[476], EgtDoorsMsg[477])
end
end
else
DoorOutLog( EgtDoorsMsg[641], 0) -- Machine name mismatch
if not DGD.NCGEN then
EgtOutBox( EgtDoorsMsg[641], EgtDoorsMsg[476], EgtDoorsMsg[477])
end
end
end
-- reset librerie locali
package.loaded[MachiningsTable] = nil
for i = 1, #tListCompo do
package.loaded[tListCompo[i]] = nil
end
end
-- effettuo la prossima ricerca
if sFindNote == 'first' then
sFindNote = 'second'
sPieceName = 'DOO*'
elseif sFindNote == 'second' then
sFindNote = 'framesx'
sPieceName = 'FRAME*'
elseif sFindNote == 'framesx' and MachJambTogh == 0 then
sFindNote = 'framedx'
sPieceName = 'FRAME*'
elseif sFindNote == 'framedx' and MachJambTogh == 0 then
sFindNote = 'frametop'
sPieceName = 'FRAME*'
elseif sFindNote == 'frametop' and MachJambTogh == 0 then
sFindNote = 'framebot'
sPieceName = 'FRAME*'
else
sFindNote = ''
end
until sFindNote == ''
-- -------------------------------------------------------------------------------------------------------------
-- -------------------------------------------------------------------------------------------------------------
-- Gestione riordino lavorazioni per macchine in linea
-- -------------------------------------------------------------------------------------------------------------
-- -------------------------------------------------------------------------------------------------------------
if OptimizeMach then
-- codice valutazione lavorazioni
end
-- -------------------------------------------------------------------------------------------------------------
-- -------------------------------------------------------------------------------------------------------------
-- reset librerie locali
package.loaded.CurrCamInfo = nil
package.loaded.CurrDoorsCustomData = nil
-- se machining lanciato DMACH do messaggio di chiusura e rendo corrente la prima macchinata
if not DGD.NCGEN then
DoorOutLog( ' ' .. EgtDoorsMsg[498]..'\n', 0)
EgtOutText( EgtDoorsMsg[498])
CloseLogFile()
EgtSetCurrMachGroup()
end
-- reset librerie globali
ResetDoorsLibs()
package.loaded.EgtDoorsBase = nil
return bOk
+2901
View File
File diff suppressed because it is too large Load Diff
+2966
View File
File diff suppressed because it is too large Load Diff
+7544
View File
File diff suppressed because it is too large Load Diff
+4631
View File
File diff suppressed because it is too large Load Diff
+4441
View File
File diff suppressed because it is too large Load Diff
+4207
View File
File diff suppressed because it is too large Load Diff
+12860
View File
File diff suppressed because it is too large Load Diff
+60
View File
@@ -0,0 +1,60 @@
--
-- EEEEEEEEEE GGGGGG wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwww wwww
-- EEEE GGGG GGGG wwww wwww wwww
-- EEEE GGGG wwww wwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEEEEE GGGG GGGGGGG wwww wwwwww wwww
-- EEEE GGGG GGGG wwww wwwwwwww wwww
-- EEEE GGGG GGGG wwww wwww wwww wwww
-- EEEEEEEEEE GGGGGGGGGG wwwwwwww wwwwwwww
-- EEEEEEEEEE GGGGGG wwwwwww wwwwwww
--
-- Main_Assemb.lua by EgalWare s.r.l. 2017.10.01
-- Main disposizione assemblato a raggruppamento
-- 2022.07.27 V1.002 FM Modification to use compiled code
-- Intestazioni
require( 'EgtBase')
_ENV = EgtProtectGlobal()
EgtEnableDebug( false)
if not _G.DGD then
_G.DGD = {}
end
-- 2022/12/27 commentate queste 4 linee perchè funziona anche senza il require EgtDoorsBase e EgtDoorsData
-- local sBaseDir = DGD.BASEDIR -- EgtGetSourceDir()
-- EgtAddToPackagePath( sBaseDir .. 'LuaLibs\\?.lua')
-- require( 'EgtDoorsBase')
-- require( 'EgtDoorsData')
-- Tavola di passaggio valori
local STU = {}
-- i parametri passati durante la creazione di una nuova componente
STU.Assembl = 1
_G.STU = STU
-----------------------------------------------------------------
-- *** Main function ***
-----------------------------------------------------------------
--se true raggruppato se false disposto
function STU.Assembled()
local sNgeFile = EgtGetCurrFilePath()
local sRequireCompoName = '_AssemblyDisp'
-- lancio il componente base
local MHgen = require( sRequireCompoName)
local bOkD = MHgen.AssemblyDispose( STU.Assembl)
-- EgtDraw()
EgtZoom( SCE_ZM.ALL, false)
EgtSaveFile( sNgeFile)
end
DGD.Assembled = Assembled
return {}
+4
View File
@@ -0,0 +1,4 @@
-- Version.lua by EgalWare s.r.l. 2025/03/18
-- Gestione della versione di Doors
VERSION = '2.7c1'