cc55202ec5
- primo commit con versione corrente.
3326 lines
136 KiB
Lua
3326 lines
136 KiB
Lua
--
|
|
-- 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
|
|
--
|
|
-- FlushBolt.lua by EgalWare s.r.l. 2016.06.14
|
|
-- Autore: Filippo Monchi
|
|
-- Flush-Bolt corner or extension type
|
|
|
|
-- 2016.09.21 V1.0a1 FM Add warning messages
|
|
-- 2017.09.05 V1.0a2 FM Not rotate face on bevel profile
|
|
-- 2018.01.16 V1.0a5 FM Manage new head mortise on extension type
|
|
-- 2018.04.05 V1.0a6 FM Manage info (KeepBackSet) for adjust probe on Z
|
|
-- 2018.05.15 V1.0a7 FM Manage info for maxfeed on connection entities
|
|
-- 2018.10.17 V1.0a8 FM Add parameter to show into message 402
|
|
-- 2018.10.22 V1.0a9 FM Manage better the big radius fillet parameter
|
|
-- 2018.10.25 V1.0aa FM Manage extra geometries on keyway and secure side
|
|
-- 2018.12.06 V1.0ab FM Disable width alignment from head face and side face
|
|
-- 2019.05.23 V1.0ac FM Manage anti-splint path on strike extra rectangle geometry
|
|
-- 2019.09.30 V1.0ad FM Manage anti-splint path on anti-splint path
|
|
-- 2019.10.11 V1.0ae FM Manage steel option (disable to generate pocket paths, mortise)
|
|
-- 2019.10.18 V2.000 FM Manage use Materials
|
|
-- 2019.10.29 V2.001 FM Add clean corner geometries
|
|
-- 2019.12.18 V2.002 FM Fix error when DGD.TYPE is not initialized (it happen when flush bolt template is used as EdgePull)
|
|
-- 2019.12.18 V2.003 FM Use new parameter DGC.Eah that allow insert template also on bullnose ans convex profiles
|
|
-- 2019.12.20 V2.004 FM fix a bug on clean corner direction path in case main paths turn reverse
|
|
-- 2020.04.29 V2.005 FM Update for aluminum material
|
|
-- 2020.05.12 V2.006 FM Add back_set parameter and manage reference (back_set or side door) to extra geometries
|
|
-- 2020.05.27 V2.007 FM Manage geometries for calculate region when frame(jamb) is disposed on wide side
|
|
-- 2020.07.01 V2.008 FM Disable Warning message on frames if parameter DGD.Spd is <= 0
|
|
-- 2020.10.20 V2.009 FM Manage 10 side extra bore groups and 5 head extra bore groups on extension type
|
|
-- 2021.01.22 V3.000 FM Manage better checking error on tools and dimension when produce flag is false
|
|
-- 2021.01.22 V3.001 FM Fix error on assign tool diameter to a wrong variable (.d7) instead of (.d4) with aluminum material
|
|
-- 2021.03.12 V3.002 FM Check and adjust the angle parameter on ebtra rectangle and extra lines
|
|
-- 2021.11.24 V3.003 FM Manage side probe option if variable DGC.Pms > 2
|
|
-- 2022.07.27 V3.004 FM Modification to use compiled code
|
|
-- 2023.03.01 V3.005 FM Manage 10 side extra bore groups and 5 head extra bore groups on corner type too
|
|
-- 2024.07.19 V3.003 FM Set note 'NotCheckDir' to pocketing and antisplint paths
|
|
-- 2024.10.07 V3.004 FM Manage probe geometry and their offset position when template is disposed
|
|
-- 2024.10.29 V3.005 FM Manage new DGC.Fpd CurrDoorCustomData variable to force shuttle probe geometry to stay horizontal
|
|
|
|
-- Tavola per definizione modulo (serve ma non usata)
|
|
local FlushBolt = {}
|
|
|
|
-- 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 dExtraH = 0.25
|
|
|
|
local function DrawAddLineDrawCircle( pInitial, pFinal, nGroup, idTable, bPrev, nGroupCirc,
|
|
nRad, bDrawFirst, bDrawLast, cColor1, cColor2, sMVar, sReference)
|
|
|
|
local nReference = GDB_RT.LOC
|
|
if sReference and sReference == 'grid' then
|
|
nReference = GDB_RT.GRID
|
|
end
|
|
|
|
local nLine = EgtLine(nGroup, pInitial, pFinal, nReference)
|
|
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 , nReference)
|
|
EgtSetColor( nCircle1, cColor1)
|
|
end
|
|
|
|
if bDrawLast then
|
|
local nCircle2 = EgtCircle( nGroupCirc, pFinal, nRad , nReference)
|
|
EgtSetColor( nCircle2, cColor2)
|
|
end
|
|
end
|
|
|
|
return nLine, nNumLine, sMVar
|
|
end
|
|
|
|
|
|
-- Funzione creazione foro o asola o rampa per asola
|
|
local function MakeBore( Lg, EB10, PX10, Int10, D10,
|
|
PY10, T10, kbs, HB10, dws,
|
|
nBI, D_XE, bRotate, dPosition, pbs)
|
|
|
|
local pIni, pEnd, pCen
|
|
local hint3
|
|
local tPath = {}
|
|
local tPathPok = {}
|
|
|
|
if EB10 ~= '' then
|
|
hint3 = EgtCircle( Lg, Point3d((PX10+Int10+D_XE),PY10, (dPosition or 0)), D10/2 , GDB_RT.LOC)
|
|
EgtModifyCurveThickness( hint3, -T10)
|
|
EgtSetName( hint3, EB10)
|
|
if bRotate then
|
|
EgtRotate( hint3, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hint3, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
end
|
|
|
|
-- se mantiene backset
|
|
if kbs and kbs > 0 then
|
|
local sKeepMode = 'c' -- setto per mantenere il centro dello spessore
|
|
EgtSetInfo( hint3, 'KeepBackSet', sKeepMode)
|
|
end
|
|
if pbs and pbs > 0 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint3, 'ProbeSide', '1')
|
|
end
|
|
|
|
if bRotate then
|
|
EgtSetInfo( hint3, 'SideDoor', 'Lock')
|
|
EgtSetInfo( hint3, 'HeadSide', 'head')
|
|
else
|
|
if HB10 then
|
|
EgtSetInfo( hint3, 'SideDoor', 'Lock')
|
|
else
|
|
EgtSetInfo (hint3, 'SideDoor', 'Side')
|
|
end
|
|
end
|
|
if dws then
|
|
local nIdSideBoxUp = EgtCopyGlob( hint3, Lg)
|
|
EgtSetName( nIdSideBoxUp, 'upper')
|
|
EgtSetInfo( nIdSideBoxUp, 'SideDoor', 'upper')
|
|
end
|
|
return nBI + 1
|
|
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
|
|
|
|
local function MakeAspOnStrikeRect( Lg, nHint, dX, dY, dThick,
|
|
dDoorTh, dShiftX, dShiftY, bRefSide, dBack_set,
|
|
dDiam, bOpposite, dZedPos, dDiam2, sSideLock,
|
|
Fc)
|
|
|
|
local nLine
|
|
local ptIni, ptEnd, pInt1, pInt1, ptIni2, ptEnd2
|
|
local tPath = {}
|
|
local nPath1, nPath2, nPath3, nPath4
|
|
local nInv = 1
|
|
|
|
if not dBack_set then dBack_set = 0 end
|
|
|
|
-- creo la linea
|
|
ptIni = Point3d( (dShiftX - max(dX, dY)), EgtIf( bRefSide, 0, -dBack_set), 0)
|
|
ptEnd = Point3d( (dShiftX + max(dX, dY)), EgtIf( bRefSide, 0, -dBack_set), 0)
|
|
nLine = DrawAddLineDrawCircle( ptIni, ptEnd, Lg, nil, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE())
|
|
|
|
if nLine then
|
|
|
|
-- verifico se ci sono intersezioni
|
|
pInt1 = EgtIP( nLine, nHint, ptIni)
|
|
pInt2 = EgtIP( nLine, nHint, ptEnd)
|
|
|
|
-- se ci sono entrambe i punti e la loro distanza è maggiore del diametro fresa
|
|
if pInt1 and pInt2 then
|
|
|
|
local dDist = dist( pInt1, pInt2)
|
|
|
|
if dDist>= dDiam then -- se larghezza maggiore dell'utensile
|
|
|
|
-- imposto la griglia
|
|
if bOpposite then
|
|
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.BACK))
|
|
nInv = -1
|
|
else
|
|
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.FRONT))
|
|
end
|
|
|
|
ptIni = Point3d( (pInt1:getX() + (dDiam/2) - dExtraH)*nInv, dDiam*3/4, -pInt1:getY())
|
|
if dDiam2 then
|
|
ptIni2 = Point3d( (pInt1:getX() + (dDiam2/2) - dExtraH)*nInv, dDiam2*3/4, -pInt1:getY())
|
|
end
|
|
|
|
if dDoorTh - dThick > GEO.EPS_SMALL then -- se spessore non passante
|
|
-- creo percorso con 3 linee
|
|
ptEnd = Point3d( ptIni:getX(), -dThick + (dDiam/2) - dExtraH, ptIni:getZ())
|
|
DrawAddLineDrawCircle( ptIni, ptEnd, Lg, tPath, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni = ptEnd
|
|
ptEnd = Point3d( (pInt2:getX() - (dDiam/2) + dExtraH)*nInv, ptIni:getY(), -pInt2:getY())
|
|
DrawAddLineDrawCircle( ptIni, ptEnd, Lg, tPath, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni = ptEnd
|
|
ptEnd = Point3d( ptIni:getX(), dDiam*3/4, ptIni:getZ())
|
|
DrawAddLineDrawCircle( ptIni, ptEnd, Lg, tPath, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
|
|
-- se il percorso esiste
|
|
if tPath then
|
|
nPath2 = EgtCurveCompo( Lg, tPath, true)
|
|
end
|
|
|
|
if dDiam2 then
|
|
-- creo il secondo percorso con 3 linee
|
|
tPath = {}
|
|
ptEnd2 = Point3d( ptIni2:getX(), -dThick + (dDiam2/2) - dExtraH, ptIni2:getZ())
|
|
DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, tPath, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni2 = ptEnd2
|
|
ptEnd2 = Point3d( (pInt2:getX() - (dDiam2/2) + dExtraH)*nInv, ptIni2:getY(), -pInt2:getY())
|
|
DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, tPath, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni2 = ptEnd2
|
|
ptEnd2 = Point3d( ptIni2:getX(), dDiam2*3/4, ptIni2:getZ())
|
|
DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, tPath, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
|
|
-- se il percorso esiste
|
|
if tPath then
|
|
nPath4 = EgtCurveCompo( Lg, tPath, true)
|
|
end
|
|
end
|
|
else -- se spessore passante
|
|
|
|
if (dDist - dDiam) < 2*dDiam then -- se larghezza minore del doppio diametro utensile
|
|
-- creo percorso con 3 linee
|
|
ptEnd = Point3d( ptIni:getX(), -dThick - (dDiam*3/4), ptIni:getZ())
|
|
DrawAddLineDrawCircle( ptIni, ptEnd, Lg, tPath, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni = ptEnd
|
|
ptEnd = Point3d( (pInt2:getX() - (dDiam/2) + dExtraH)*nInv, ptIni:getY(), -pInt2:getY())
|
|
DrawAddLineDrawCircle( ptIni, ptEnd, Lg, tPath, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni = ptEnd
|
|
ptEnd = Point3d( ptIni:getX(), dDiam*3/4, ptIni:getZ())
|
|
DrawAddLineDrawCircle( ptIni, ptEnd, Lg, tPath, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
|
|
-- se il percorso esiste
|
|
if tPath then
|
|
nPath2 = EgtCurveCompo( Lg, tPath, true)
|
|
end
|
|
|
|
if dDiam2 then
|
|
-- creo il secondo percorso con 3 linee
|
|
tPath = {}
|
|
ptEnd2 = Point3d( ptIni2:getX(), -dThick - (dDiam2*3/4), ptIni2:getZ())
|
|
DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, tPath, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni2 = ptEnd2
|
|
ptEnd2 = Point3d( (pInt2:getX() - (dDiam2/2) + dExtraH)*nInv, ptIni2:getY(), -pInt2:getY())
|
|
DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, tPath, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
ptIni2 = ptEnd2
|
|
ptEnd2 = Point3d( ptIni2:getX(), dDiam2*3/4, ptIni2:getZ())
|
|
DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, tPath, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
|
|
-- se il percorso esiste
|
|
if tPath then
|
|
nPath4 = EgtCurveCompo( Lg, tPath, true)
|
|
end
|
|
end
|
|
else -- larghezza maggiore del doppio diametro, creao due linee distinte
|
|
|
|
-- creo 2 persorsi composti da una linea ciascuno
|
|
ptEnd = Point3d( ptIni:getX(), -dThick - (dDiam*3/4), ptIni:getZ())
|
|
nPath1 = DrawAddLineDrawCircle( ptIni, ptEnd, Lg, nil, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
|
|
ptIni = Point3d( (pInt2:getX() - (dDiam/2) + dExtraH)*nInv, ptEnd:getY(), -pInt2:getY())
|
|
ptEnd = Point3d( ptIni:getX(), (dDiam*3/4), ptIni:getZ())
|
|
nPath2 = DrawAddLineDrawCircle( ptIni, ptEnd, Lg, nil, false, nil, (dDiam/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
|
|
if dDiam2 then
|
|
-- creo 2 persorsi composti da una linea ciascuno
|
|
ptEnd2 = Point3d( ptIni2:getX(), -dThick - (dDiam2*3/4), ptIni2:getZ())
|
|
nPath3 = DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, nil, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
|
|
ptIni2 = Point3d( (pInt2:getX() - (dDiam2/2) + dExtraH)*nInv, ptEnd2:getY(), -pInt2:getY())
|
|
ptEnd2 = Point3d( ptIni2:getX(), (dDiam2*3/4), ptIni2:getZ())
|
|
nPath4 = DrawAddLineDrawCircle( ptIni2, ptEnd2, Lg, nil, false, nil, (dDiam2/2), true, true, ORANGE(), ORANGE(), nil, 'grid')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- se esistono gli eventuali percorso setto spessore 0
|
|
if nPath1 then
|
|
EgtModifyCurveThickness(nPath1, 0)
|
|
if sSideLock == 'L' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath1)
|
|
end
|
|
if string.lower(Fc) == 'keyway' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath1)
|
|
end
|
|
end
|
|
if nPath2 then
|
|
EgtModifyCurveThickness(nPath2, 0)
|
|
if sSideLock == 'L' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath2)
|
|
end
|
|
if string.lower(Fc) == 'keyway' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath2)
|
|
end
|
|
end
|
|
if nPath3 then
|
|
EgtModifyCurveThickness(nPath3, 0)
|
|
if sSideLock == 'R' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath3)
|
|
end
|
|
if string.lower(Fc) == 'keyway' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath3)
|
|
end
|
|
end
|
|
if nPath4 then
|
|
EgtModifyCurveThickness(nPath4, 0)
|
|
if sSideLock == 'R' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath4)
|
|
end
|
|
if string.lower(Fc) == 'keyway' then
|
|
-- inverto il percorso
|
|
EgtInvertCurve(nPath4)
|
|
end
|
|
end
|
|
|
|
-- re-imposto la griglia da sopra
|
|
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.TOP))
|
|
end
|
|
-- elimino la linea
|
|
EgtErase(nLine)
|
|
end
|
|
|
|
return nPath1, nPath2, nPath3, nPath4
|
|
end
|
|
|
|
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 FlushBolt.AdjustParams( tMhPar)
|
|
|
|
tMhPar.invG = 1
|
|
|
|
local EgtDoorsMsg = require( 'EgtDoorsMsg')
|
|
local dMaxMat0
|
|
local dMaxMat00
|
|
local dMaxMat1
|
|
local dMaxMat2
|
|
local dMaxMat4
|
|
local dMaxMat5
|
|
local dMaxMat6
|
|
local dMaxMat7
|
|
local dMaxMat8
|
|
local dMaxMat9
|
|
local dMaxMat10
|
|
local dNumMessage
|
|
local dNumLog = 0
|
|
local sMessToOut = ''
|
|
local nTempT0
|
|
local nTempT00
|
|
local nTempT1
|
|
local nTempT2
|
|
local nTempT3
|
|
local nTempT4
|
|
local nTempT5
|
|
local nTempT6
|
|
local nTempT7
|
|
local nTempT8
|
|
local nTempT9
|
|
local nTempT10
|
|
local sMchngName0
|
|
local sMchngName00
|
|
local sMchngName1
|
|
local sMchngName2
|
|
local sMchngName3
|
|
local sMchngName4
|
|
local sMchngName5
|
|
local sMchngName6
|
|
local sMchngName7
|
|
local sMchngName8
|
|
local sMchngName9
|
|
local sMchngName10
|
|
local dOffset = DGD.OFFSET or 0
|
|
|
|
-- parametro disposizione frame su lato wide (se = nil è sulla porta, se true dispsizione frame sul lato wide, se false dispsozione su lato narrow)
|
|
tMhPar.Dws = DGD.Dws
|
|
|
|
if tMhPar.Dws then -- se disposto sul lato wide, calcolo lo spessore relativo
|
|
if DGD.nTypePz == 3 or DGD.nTypePz == 4 then
|
|
tMhPar.dThD = DGD.dW
|
|
elseif DGD.nTypePz == 5 or DGD.nTypePz == 6 then
|
|
tMhPar.dThD = DGD.dH
|
|
end
|
|
end
|
|
|
|
-- do errore se il tipo flushbolt non è adatto per il tipo di porta ( inactive)
|
|
if not( DGD.sSwing == 'LHI' or DGD.sSwing == 'RHI' or DGD.sSwing == 'RHRI' or DGD.sSwing == 'LHRI') and not DGC.Eif then
|
|
return tMhPar, 1798, string.format(EgtDoorsMsg[458], tMhPar.Nome, DGD.sSwing)
|
|
end
|
|
|
|
-- do errore se profilo tipo bullnose e convesso e non è ammesso
|
|
if not DGC.Eah and ( DGD.tProfs.lockedge.trimming == 'CV' or
|
|
DGD.tProfs.lockedge.trimming == '1B' or DGD.tProfs.lockedge.trimming == '2B' or
|
|
DGD.tProfs.lockedge.trimming == '3B' or DGD.tProfs.lockedge.trimming == '4B' or
|
|
DGD.tProfs.lockedge.trimming == '5B' or DGD.tProfs.lockedge.trimming == '6B' or
|
|
DGD.tProfs.lockedge.trimming == '7B' or DGD.tProfs.lockedge.trimming == '8B') then
|
|
return tMhPar, 1799, string.format(EgtDoorsMsg[430], tMhPar.Nome, DGD.tProfs.lockedge.trimming)
|
|
end
|
|
|
|
-- se profilo bevel disabilito la giunzione tra face e mortise
|
|
if DGD.tProfs.lockedge.trimming == 'BD' or DGD.tProfs.lockedge.trimming == 'BU' or
|
|
DGD.tProfs.lockedge.trimming == 'BDEB' or DGD.tProfs.lockedge.trimming == 'BUEB' then
|
|
tMhPar.jnb = false
|
|
-- setto il flag che indica profilo bevel
|
|
tMhPar.bev = true
|
|
else
|
|
tMhPar.jnb = true
|
|
end
|
|
|
|
-- overcast del parametro di distanza foro in testa (che è il riferimento anche per la cava in testa)
|
|
if DGD.BACK_SET and DGD.BACK_SET > 0 then
|
|
tMhPar.DB_X = DGD.BACK_SET
|
|
end
|
|
|
|
-- se frame annullo il parametro position
|
|
if DGD.sFrame and ( DGD.sFrame == 'T' or DGD.sFrame == 'TE' or DGD.sFrame == 'B' or DGD.sFrame == 'BE') then
|
|
DGD.POSITION = 0
|
|
end
|
|
|
|
-- se serratura su lato destro setto il flag per invertire i percorsi
|
|
if DGD.Lock == 'R' then tMhPar.invG = -tMhPar.invG end
|
|
|
|
tMhPar.SL = DGD.Lock
|
|
|
|
if tMhPar.dl and tMhPar.H and tMhPar.T and tMhPar.T > 0 and not tMhPar.jnb then
|
|
-- se non ruoto face risetto il flag che impedisce il chain tra face e mortise
|
|
tMhPar.jnb = true
|
|
-- ricalcolo la profondità per avere spessore minomo = al valore di .T
|
|
tMhPar.T = tMhPar.T + EgtIf( DGC.Bwd and DGC.Bwd == 2, 0, (( tMhPar.H/2) * TAN3))
|
|
else
|
|
tMhPar.dl = false
|
|
end
|
|
|
|
-- se non ho il parametro lo setto disattivato
|
|
if not tMhPar.ech then
|
|
tMhPar.ech = false
|
|
end
|
|
-- se non ho il parametro lo setto disattivato
|
|
if not tMhPar.ech4 then
|
|
tMhPar.ech4 = false
|
|
end
|
|
|
|
-- se non c'è la variabile suffisso
|
|
if not tMhPar.CH then
|
|
tMhPar.CH = '_Chisel'
|
|
end
|
|
|
|
-- se non ho il parametro D_XE lo setto a 0
|
|
if not tMhPar.D_XE then
|
|
tMhPar.D_XE = 0
|
|
end
|
|
|
|
-- se c'è la variabile CurrCamInfo che indica che la porta è disposta con il lato lock sul lato navetta
|
|
-- e il template non è sui lati top e bottom
|
|
if DGD.SDF and DGD.SDF > 1 then
|
|
|
|
-- calcolo la posizione del centro foro sullo spessore porta
|
|
if dOffset > 0 then
|
|
if ( DGD.SIDE == 'top' and DGD.Push) or ( DGD.SIDE ~= 'top' and not DGD.Push) then
|
|
tMhPar.posh = (DGD.dT/2) - dOffset
|
|
else
|
|
tMhPar.posh = -(DGD.dT/2) + dOffset
|
|
end
|
|
else
|
|
tMhPar.posh = 0
|
|
end
|
|
|
|
if tMhPar.bev and not tMhPar.dl and not DGC.Fpd then
|
|
tMhPar.posh = tMhPar.posh / cos( 3)
|
|
end
|
|
end
|
|
tMhPar.SD = DGD.SIDE
|
|
|
|
-- se viene utilizzato il flush bolt come EdgePull, il parametro type non viene passato
|
|
-- e setto di default come extensione
|
|
if not DGD.TYPE then DGD.TYPE = 'extension' end
|
|
|
|
-- se corner, disattivo alcuni parametri dell'extension e viceversa
|
|
if string.lower(DGD.TYPE) == 'corner' then
|
|
tMhPar.mc = true -- abilito il flag che indica il corner
|
|
if tMhPar.mh then -- se ho attivo il foro sul fianco
|
|
-- tMhPar.L2 = nil -- azzero
|
|
tMhPar.H2 = nil -- azzero side bore depth
|
|
tMhPar.T2 = nil -- azzero side bore depth
|
|
end
|
|
tMhPar.mh = false -- disabilito il foro laterale
|
|
tMhPar.H3 = nil -- azzero top/bottom bore diameter
|
|
tMhPar.T3 = nil -- azzero top/bottom bore depth
|
|
tMhPar.LG3 = nil -- azzero label top/bottom bore depth
|
|
tMhPar.H6 = nil -- azzero top/bottom mortise width
|
|
tMhPar.T6 = nil -- azzero top/bottom mortise depth
|
|
tMhPar.LG6 = nil -- azzero label top/bottom bore depth
|
|
tMhPar.D_X = 0 -- azzero il decentramento foro/mortasa sul lato
|
|
tMhPar.DB_X = 0 -- distaza dal corner per top/bottom bore
|
|
tMhPar.DF_X = 0 -- distaza dal corner per top/bottom face
|
|
tMhPar.D_XE = 0 -- distanza dal corner per geometrie sul fianco
|
|
|
|
-- if tMhPar.H then
|
|
-- tMhPar.H4 = tMhPar.H -- setto top/bottom face alta come la face
|
|
-- end
|
|
if tMhPar.rf then --(prelazione del face corner)
|
|
tMhPar.rf4 = tMhPar.rf -- setto top/bottom radius face cone il radius face
|
|
end
|
|
-- prima assegno al cl del face di testa il valore del cl del fianco
|
|
if tMhPar.cl then --(prelazione del face corner)
|
|
tMhPar.cl4 = tMhPar.cl -- setto arrotondamento preso dal face principale
|
|
end
|
|
|
|
-- prima assegno ai parametri clean corner del face di testa i parametri del clean corner del face di fianco
|
|
-- uso il .L per essere sicuro che ci siano i parametri del face di sianco
|
|
if tMhPar.CLC and tMhPar.L then --(prelazione del face corner)
|
|
tMhPar.CLC4 = tMhPar.CLC -- setto nome geometria preso dal face principale
|
|
end
|
|
if tMhPar.clc and tMhPar.L then --(prelazione del face corner)
|
|
tMhPar.clc4 = tMhPar.clc -- setto nome geometria preso dal face principale
|
|
end
|
|
if tMhPar.ccr and tMhPar.L then --(prelazione del face corner)
|
|
tMhPar.ccr4 = tMhPar.ccr -- setto nome geometria preso dal face principale
|
|
end
|
|
|
|
-- se ho il raccordo sulla head face disabilito il chisel e il clean corner
|
|
if tMhPar.cl4 and ( tMhPar.cl4 == 1 or tMhPar.cl4 == 3) then
|
|
tMhPar.ech4 = false
|
|
tMhPar.clc4 = nil
|
|
tMhPar.CLC4 = nil
|
|
end
|
|
if not tMhPar.cl then
|
|
tMhPar.cl = 0
|
|
end
|
|
-- se arrotondo entrambe le estremità disabilito il chisel e il clean corner
|
|
if tMhPar.cl and tMhPar.cl >= 2 then
|
|
tMhPar.ech = false
|
|
tMhPar.clc = nil
|
|
tMhPar.CLC = nil
|
|
end
|
|
else -- altrimenti tipo extension
|
|
tMhPar.mc = false -- disabilito il flag che indica il corner
|
|
if not tMhPar.cl4 then
|
|
tMhPar.cl4 = 0
|
|
end
|
|
-- se arrotondo entrambe le estremità disabilito il chisel e il clean corner
|
|
if tMhPar.cl4 == 3 then
|
|
tMhPar.ech4 = false
|
|
tMhPar.clc4 = nil
|
|
tMhPar.CLC4 = nil
|
|
end
|
|
if not tMhPar.cl then
|
|
tMhPar.cl = 0
|
|
end
|
|
-- se arrotondo entrambe le estremità disabilito il chisel
|
|
if tMhPar.cl and tMhPar.cl == 3 then
|
|
tMhPar.ech = false
|
|
tMhPar.clc = nil
|
|
tMhPar.CLC = nil
|
|
end
|
|
end
|
|
|
|
if not tMhPar.rf then
|
|
tMhPar.rf = 0
|
|
if tMhPar.cl > 0 and tMhPar.H then
|
|
tMhPar.rf = tMhPar.H/2
|
|
end
|
|
end
|
|
|
|
if not tMhPar.rf4 then
|
|
tMhPar.rf4 = 0
|
|
if tMhPar.cl4 and tMhPar.cl4 > 0 and tMhPar.H4 then
|
|
tMhPar.rf4 = tMhPar.H4/2
|
|
end
|
|
end
|
|
|
|
-- Assegno parametri da dati utensili in macchina
|
|
local MB = require( 'MachiningBase')
|
|
local sLM
|
|
local nLMi = 1
|
|
local sLA
|
|
local nLAi = 1
|
|
local sLGH
|
|
local nLGHi = 1
|
|
local sLG3
|
|
local nLG3i = 1
|
|
local sLM4
|
|
local nLM4i = 1
|
|
local sLM5
|
|
local nLM5i = 1
|
|
local sLM6
|
|
local nLM6i = 1
|
|
local sLM7
|
|
local nLM7i = 1
|
|
local sLG
|
|
local nLGi = 1
|
|
local sLG4
|
|
local nLG4i = 1
|
|
local sASG -- anti-splint on rectangle
|
|
local nASGi = 1
|
|
local sASGR -- anti-splint on antisplint
|
|
local nASGRi = 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.LM4 = nil
|
|
tMhPar.LM5 = nil
|
|
tMhPar.LM6 = nil
|
|
tMhPar.LM7 = nil
|
|
tMhPar.ech = false
|
|
tMhPar.ech4 = false
|
|
tMhPar.CH = nil
|
|
tMhPar.est = true
|
|
tMhPar.d5 = nil
|
|
tMhPar.d7 = nil
|
|
tMhPar.ASG = 0
|
|
tMhPar.EAR = nil
|
|
tMhPar.das = nil
|
|
else
|
|
tMhPar.est = nil
|
|
end
|
|
|
|
-- devo considerare il profilo serratura e se eventualmente è opposto a quello cerniere
|
|
if DGD.tProfs.lockedge.trimming == 'BU' or DGD.tProfs.lockedge.trimming == 'BUEB' then -- profilo serrratura bevel up
|
|
-- se lato cerniere opposto mi troverò il bevel al contrario perché comanda il lato cerniere
|
|
if DGD.bBothOppoBevel then
|
|
nLMi = 3
|
|
nLM7i = 3
|
|
nLGi = 3
|
|
else
|
|
nLMi = 2
|
|
nLM7i = 2
|
|
nLGi = 2
|
|
end
|
|
elseif DGD.tProfs.lockedge.trimming == 'BD' or DGD.tProfs.lockedge.trimming == 'BDEB' then -- profilo serrratura bevel dn
|
|
-- se lato cerniere opposto mi troverò il bevel al contrario perché comanda il lato cerniere
|
|
if DGD.bBothOppoBevel then
|
|
nLMi = 2
|
|
nLM7i = 2
|
|
nLGi = 2
|
|
else
|
|
nLMi = 3
|
|
nLM7i = 3
|
|
nLGi = 3
|
|
end
|
|
end
|
|
|
|
if tMhPar.est and tMhPar.LG then -- se altro materiale
|
|
sLG = tMhPar.LG
|
|
if DGD.MachEn > 0 and tMhPar.d then nTempT0, dMaxMat0, sMchngName0 = MB.GetToolDataFromAttrib( sLG, nLGi) end
|
|
end
|
|
|
|
if tMhPar.est and tMhPar.LG4 then -- se altro materiale
|
|
sLG4 = tMhPar.LG4
|
|
if DGD.MachEn > 0 and tMhPar.d4 then nTempT00, dMaxMat00, sMchngName00 = MB.GetToolDataFromAttrib( sLG4, nLG4i) end
|
|
end
|
|
|
|
if tMhPar.LM then
|
|
sLM = tMhPar.LM
|
|
if DGD.MachEn > 0 and tMhPar.d then nTempT1, dMaxMat1, sMchngName1 = MB.GetToolDataFromAttrib( sLM, nLMi) end
|
|
end
|
|
|
|
if tMhPar.LM7 then
|
|
sLM7 = tMhPar.LM7
|
|
if DGD.MachEn > 0 and tMhPar.d7 then nTempT8, dMaxMat8, sMchngName8 = MB.GetToolDataFromAttrib( sLM7, nLM7i) 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
|
|
|
|
if tMhPar.ech4 and tMhPar.LG4 then -- se chisel abilitato
|
|
sLG4 = tMhPar.LG4 .. tMhPar.CH
|
|
tMhPar.d00 = 0
|
|
if DGD.MachEn > 0 and tMhPar.d00 then nTempT00, dMaxMat00, sMchngName00 = MB.GetToolDataFromAttrib( sLG4, nLG4i) end
|
|
end
|
|
|
|
if tMhPar.LA then
|
|
sLA = tMhPar.LA
|
|
if DGD.MachEn > 0 and tMhPar.d2 then nTempT2, dMaxMat2, sMchngName2 = MB.GetToolDataFromAttrib( sLA, nLAi) end
|
|
end
|
|
|
|
if tMhPar.mh and tMhPar.LGH then
|
|
sLGH = tMhPar.LGH
|
|
if DGD.MachEn > 0 then nTempT3, dMaxMat2, sMchngName3 = MB.GetToolDataFromAttrib( sLGH, nLGHi) end -- nel foro non ha importanza il diametro utensile
|
|
end
|
|
|
|
if tMhPar.LG3 then
|
|
sLG3 = tMhPar.LG3
|
|
if DGD.MachEn > 0 then nTempT4, dMaxMat4, sMchngName4 = MB.GetToolDataFromAttrib( sLG3, nLG3i) end -- nel foro non ha importanza il diametro utensile
|
|
end
|
|
|
|
if tMhPar.LM4 then
|
|
sLM4 = tMhPar.LM4
|
|
if DGD.MachEn > 0 and tMhPar.d4 then nTempT5, dMaxMat5, sMchngName5 = MB.GetToolDataFromAttrib( sLM4, nLM4i) end
|
|
end
|
|
|
|
if tMhPar.LM5 then
|
|
sLM5 = tMhPar.LM5
|
|
if DGD.MachEn > 0 and tMhPar.d5 then nTempT6, dMaxMat6, sMchngName6 = MB.GetToolDataFromAttrib( sLM5, nLM5i) end
|
|
end
|
|
|
|
if tMhPar.LM6 then
|
|
sLM6 = tMhPar.LM6
|
|
if DGD.MachEn > 0 and tMhPar.d6 then nTempT7, dMaxMat7, sMchngName7 = MB.GetToolDataFromAttrib( sLM6, nLM6i) 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
|
|
|
|
-- extra rectangles
|
|
if tMhPar.TR10 then
|
|
if tMhPar.TR10 == -0.5 then
|
|
tMhPar.TR10 = DGD.dT / 2
|
|
elseif tMhPar.TR10 == -1 or tMhPar.TR10 > DGD.dT then
|
|
tMhPar.TR10 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR11 then
|
|
if tMhPar.TR11 == -0.5 then
|
|
tMhPar.TR11 = DGD.dT / 2
|
|
elseif tMhPar.TR11 == -1 or tMhPar.TR11 > DGD.dT then
|
|
tMhPar.TR11 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR12 then
|
|
if tMhPar.TR12 == -0.5 then
|
|
tMhPar.TR12 = DGD.dT / 2
|
|
elseif tMhPar.TR12 == -1 or tMhPar.TR12 > DGD.dT then
|
|
tMhPar.TR12 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR13 then
|
|
if tMhPar.TR13 == -0.5 then
|
|
tMhPar.TR13 = DGD.dT / 2
|
|
elseif tMhPar.TR13 == -1 or tMhPar.TR13 > DGD.dT then
|
|
tMhPar.TR13 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR14 then
|
|
if tMhPar.TR14 == -0.5 then
|
|
tMhPar.TR14 = DGD.dT / 2
|
|
elseif tMhPar.TR14 == -1 or tMhPar.TR14 > DGD.dT then
|
|
tMhPar.TR14 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR20 then
|
|
if tMhPar.TR20 == -0.5 then
|
|
tMhPar.TR20 = DGD.dT / 2
|
|
elseif tMhPar.TR20 == -1 or tMhPar.TR20 > DGD.dT then
|
|
tMhPar.TR20 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR21 then
|
|
if tMhPar.TR21 == -0.5 then
|
|
tMhPar.TR21 = DGD.dT / 2
|
|
elseif tMhPar.TR21 == -1 or tMhPar.TR21 > DGD.dT then
|
|
tMhPar.TR21 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR22 then
|
|
if tMhPar.TR22 == -0.5 then
|
|
tMhPar.TR22 = DGD.dT / 2
|
|
elseif tMhPar.TR22 == -1 or tMhPar.TR22 > DGD.dT then
|
|
tMhPar.TR22 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR23 then
|
|
if tMhPar.TR23 == -0.5 then
|
|
tMhPar.TR23 = DGD.dT / 2
|
|
elseif tMhPar.TR23 == -1 or tMhPar.TR23 > DGD.dT then
|
|
tMhPar.TR23 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TR24 then
|
|
if tMhPar.TR24 == -0.5 then
|
|
tMhPar.TR24 = DGD.dT / 2
|
|
elseif tMhPar.TR24 == -1 or tMhPar.TR24 > DGD.dT then
|
|
tMhPar.TR24 = DGD.dT
|
|
end
|
|
end
|
|
|
|
-- Anti-splint su extra rettangoli
|
|
if DGD.MachEn > 0 and tMhPar.ASG and tMhPar.EAR and
|
|
( ( tMhPar.TR10 and tMhPar.TR10 > GEO.EPS_SMALL) or ( tMhPar.TR11 and tMhPar.TR11 > GEO.EPS_SMALL) or ( tMhPar.TR12 and tMhPar.TR12 > GEO.EPS_SMALL) or
|
|
( tMhPar.TR13 and tMhPar.TR13 > GEO.EPS_SMALL) or ( tMhPar.TR14 and tMhPar.TR14 > GEO.EPS_SMALL) or ( tMhPar.TR20 and tMhPar.TR20 > GEO.EPS_SMALL) or
|
|
( tMhPar.TR21 and tMhPar.TR21 > GEO.EPS_SMALL) or ( tMhPar.TR22 and tMhPar.TR22 > GEO.EPS_SMALL) or ( tMhPar.TR23 and tMhPar.TR23 > GEO.EPS_SMALL) or
|
|
( tMhPar.TR24 and tMhPar.TR24 > GEO.EPS_SMALL)) then
|
|
sASG = tMhPar.ASG
|
|
nTempT9, dMaxMat9, sMchngName9 = MB.GetToolDataFromAttrib( sASG, nASGi)
|
|
end
|
|
|
|
-- Anti-splint su Anti-splint
|
|
if DGD.MachEn > 0 and tMhPar.EAR and tMhPar.EAR == 2 and sASG then
|
|
sASGR = tMhPar.ASG..'_R'
|
|
tMhPar.ASGR = sASGR
|
|
tMhPar.das2 = tMhPar.das
|
|
nTempT10, dMaxMat10, sMchngName10 = MB.GetToolDataFromAttrib( sASGR, nASGRi)
|
|
end
|
|
|
|
-- extra lines
|
|
if tMhPar.TL10 then
|
|
if tMhPar.TL10 == -0.5 then
|
|
tMhPar.TL10 = DGD.dT / 2
|
|
elseif tMhPar.TL10 == -1 or tMhPar.TL10 > DGD.dT then
|
|
tMhPar.TL10 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL11 then
|
|
if tMhPar.TL11 == -0.5 then
|
|
tMhPar.TL11 = DGD.dT / 2
|
|
elseif tMhPar.TL11 == -1 or tMhPar.TL11 > DGD.dT then
|
|
tMhPar.TL11 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL12 then
|
|
if tMhPar.TL12 == -0.5 then
|
|
tMhPar.TL12 = DGD.dT / 2
|
|
elseif tMhPar.TL12 == -1 or tMhPar.TL12 > DGD.dT then
|
|
tMhPar.TL12 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL13 then
|
|
if tMhPar.TL13 == -0.5 then
|
|
tMhPar.TL13 = DGD.dT / 2
|
|
elseif tMhPar.TL13 == -1 or tMhPar.TL13 > DGD.dT then
|
|
tMhPar.TL13 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL14 then
|
|
if tMhPar.TL14 == -0.5 then
|
|
tMhPar.TL14 = DGD.dT / 2
|
|
elseif tMhPar.TL14 == -1 or tMhPar.TL14 > DGD.dT then
|
|
tMhPar.TL14 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL20 then
|
|
if tMhPar.TL20 == -0.5 then
|
|
tMhPar.TL20 = DGD.dT / 2
|
|
elseif tMhPar.TL20 == -1 or tMhPar.TL20 > DGD.dT then
|
|
tMhPar.TL20 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL21 then
|
|
if tMhPar.TL21 == -0.5 then
|
|
tMhPar.TL21 = DGD.dT / 2
|
|
elseif tMhPar.TL21 == -1 or tMhPar.TL21 > DGD.dT then
|
|
tMhPar.TL21 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL22 then
|
|
if tMhPar.TL22 == -0.5 then
|
|
tMhPar.TL22 = DGD.dT / 2
|
|
elseif tMhPar.TL22 == -1 or tMhPar.TL22 > DGD.dT then
|
|
tMhPar.TL22 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL23 then
|
|
if tMhPar.TL23 == -0.5 then
|
|
tMhPar.TL23 = DGD.dT / 2
|
|
elseif tMhPar.TL23 == -1 or tMhPar.TL23 > DGD.dT then
|
|
tMhPar.TL23 = DGD.dT
|
|
end
|
|
end
|
|
|
|
if tMhPar.TL24 then
|
|
if tMhPar.TL24 == -0.5 then
|
|
tMhPar.TL24 = DGD.dT / 2
|
|
elseif tMhPar.TL24 == -1 or tMhPar.TL24 > DGD.dT then
|
|
tMhPar.TL24 = DGD.dT
|
|
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 = -1794
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT0, sLG, nLGi, tMhPar.d, dNumLog, sMchngName0)
|
|
elseif tMhPar.est and nTempT0 then
|
|
tMhPar.d = nTempT0
|
|
end
|
|
|
|
-- gestisco il risultato della lettura utensili
|
|
if DGD.bProoduce and tMhPar.est and tMhPar.d4 and nTempT00 and nTempT00 <= 0 then
|
|
dNumLog = -1794
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT00, sLG4, nLG4i, tMhPar.d4, dNumLog, sMchngName00)
|
|
elseif tMhPar.est and nTempT00 then
|
|
tMhPar.d4 = nTempT00
|
|
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 = -1794
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT1, sLM, nLMi, tMhPar.d, dNumLog, sMchngName1)
|
|
elseif not tMhPar.est and nTempT1 then
|
|
tMhPar.d = nTempT1
|
|
end
|
|
|
|
if not tMhPar.est and tMhPar.d2 and nTempT2 and nTempT2 <= 0 then
|
|
if DGD.bProoduce and not tMhPar.jn then -- se non si concatenano i due percorsi
|
|
dNumLog = -1794
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT2, sLA, nLAi, tMhPar.d2, dNumLog, sMchngName2)
|
|
end
|
|
elseif not tMhPar.est and nTempT2 then
|
|
tMhPar.d2 = nTempT2
|
|
end
|
|
|
|
-- gestisco il risultato della lettura utensili per antischeggia su extra rettangoli
|
|
if DGD.bProoduce and not tMhPar.est and tMhPar.das and nTempT9 and nTempT9 <= 0 then
|
|
dNumLog = -1794
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT9, sASG, nASGi, tMhPar.das, dNumLog, sMchngName9)
|
|
elseif not tMhPar.est and nTempT9 then
|
|
tMhPar.das = nTempT9
|
|
end
|
|
|
|
-- gestisco il risultato della lettura utensili per antischeggia su antischeggia
|
|
if DGD.bProoduce and not tMhPar.est and tMhPar.das2 and nTempT10 and nTempT10 <= 0 then
|
|
dNumLog = -1794
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT10, sASGR, nASGRi, tMhPar.das2, dNumLog, sMchngName10)
|
|
elseif not tMhPar.est and nTempT10 then
|
|
tMhPar.das2 = nTempT10
|
|
end
|
|
|
|
if DGD.bProoduce and tMhPar.mh and tMhPar.LGH and not dMaxMat2 then
|
|
dNumLog = -1793
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT3, sLGH, nLGHi, nil, dNumLog, sMchngName3)
|
|
end
|
|
|
|
if DGD.bProoduce and tMhPar.LG3 and not dMaxMat4 then
|
|
dNumLog = -1793
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT4, sLG3, nLG3i, nil, dNumLog, sMchngName4)
|
|
end
|
|
|
|
if DGD.bProoduce and not tMhPar.est and tMhPar.d4 and nTempT5 and nTempT5 <= 0 then
|
|
dNumLog = -1794
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT5, sLM4, nLM4i, tMhPar.d4, dNumLog, sMchngName5)
|
|
elseif not tMhPar.est and nTempT5 then
|
|
tMhPar.d4 = nTempT5
|
|
end
|
|
|
|
if not tMhPar.est and tMhPar.d6 and nTempT7 and nTempT7 <= 0 then
|
|
if DGD.bProoduce and not tMhPar.jn6 then -- se non si concatenano i due percorsi
|
|
dNumLog = -1789
|
|
sMessToOut = sMessToOut .. '\n'.. GetMachToolErrorMessage( nTempT7, sLM6, nLM6i, tMhPar.d6, dNumLog, sMchngName7)
|
|
end
|
|
elseif not tMhPar.est and nTempT7 then
|
|
tMhPar.d6 = nTempT7
|
|
end
|
|
|
|
-- chiseling
|
|
if tMhPar.ech and tMhPar.d0 and nTempT0 > 0 then
|
|
tMhPar.d0 = nTempT0
|
|
end
|
|
|
|
-- chiseling su head face
|
|
if tMhPar.ech4 and tMhPar.d00 and nTempT00 > 0 then
|
|
tMhPar.d00 = nTempT00
|
|
end
|
|
|
|
-- se la profondità della face 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 = -1785
|
|
dNumMessage = 460
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat0))
|
|
tMhPar.T = dMaxMat0
|
|
end
|
|
|
|
if tMhPar.est and tMhPar.T4 and dMaxMat00 and tMhPar.T4 > dMaxMat00 then
|
|
dNumLog = -1784
|
|
dNumMessage = 460
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T4), EgtToUiUnits(dMaxMat00))
|
|
tMhPar.T4 = dMaxMat00
|
|
end
|
|
|
|
-- se la profondità della face è maggiore della capacità utensile limito la profondità ed emetto un warning
|
|
if tMhPar.T and dMaxMat1 and tMhPar.T > dMaxMat1 then
|
|
dNumLog = -1797
|
|
dNumMessage = 460
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat1))
|
|
tMhPar.T = dMaxMat1 - 0.02 -- tolgo 0.02 per permettere la lavorazione
|
|
end
|
|
|
|
-- se la profondità della face è maggiore della capacità utensile anti-splint limito la profondità ed emetto un warning
|
|
if tMhPar.T and dMaxMat8 and tMhPar.T > dMaxMat8 then
|
|
dNumLog = -1786
|
|
dNumMessage = 462
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T), EgtToUiUnits(dMaxMat8))
|
|
tMhPar.T = dMaxMat8
|
|
end
|
|
|
|
-- se mortise concatenata a face e la profondità della mortise è maggiore della capacità utensile,
|
|
-- limito la profondità ed emetto un warning
|
|
if tMhPar.jn and not tMhPar.mh and tMhPar.jnb and
|
|
tMhPar.T2 and dMaxMat1 and tMhPar.T2 > dMaxMat1 then
|
|
dNumLog = -1796
|
|
dNumMessage = 461
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T2), EgtToUiUnits(dMaxMat1))
|
|
tMhPar.T2 = dMaxMat1
|
|
end
|
|
|
|
-- se mortise non concatenata a face e la profondità della mortise è maggiore della capacità utensile,
|
|
-- limito la profondità ed emetto un warning
|
|
if ( not tMhPar.jn or tMhPar.mh or not tMhPar.jnb) and
|
|
tMhPar.T2 and dMaxMat2 and tMhPar.T2 > dMaxMat2 then
|
|
dNumLog = -1795
|
|
if tMhPar.mh then
|
|
dNumMessage = 463
|
|
else
|
|
dNumMessage = 461
|
|
end
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T2), EgtToUiUnits(dMaxMat2))
|
|
tMhPar.T2 = dMaxMat2
|
|
end
|
|
|
|
-- se profondità foro di testa è maggiore della capacità utensile
|
|
if tMhPar.T3 and dMaxMat4 and tMhPar.T3 > dMaxMat4 then
|
|
dNumLog = -1792
|
|
dNumMessage = 463
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T3), EgtToUiUnits(dMaxMat4))
|
|
tMhPar.T3 = dMaxMat4
|
|
end
|
|
|
|
-- se la profondità della face è maggiore della capacità utensile limito la profondità ed emetto un warning
|
|
if tMhPar.T4 and dMaxMat5 and tMhPar.T4 > dMaxMat5 then
|
|
dNumLog = -1791
|
|
dNumMessage = 460
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T4), EgtToUiUnits(dMaxMat5))
|
|
tMhPar.T4 = dMaxMat5
|
|
end
|
|
|
|
-- se la profondità della face è maggiore della capacità utensile antisplint limito la profondità ed emetto un warning
|
|
if tMhPar.T4 and dMaxMat6 and tMhPar.T4 > dMaxMat6 then
|
|
dNumLog = -1790
|
|
dNumMessage = 462
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T4), EgtToUiUnits(dMaxMat6))
|
|
tMhPar.T4 = dMaxMat6
|
|
end
|
|
|
|
-- se head mortise concatenata a head face e la profondità della head mortise è maggiore della capacità utensile,
|
|
-- limito la profondità ed emetto un warning
|
|
if tMhPar.jn6 and tMhPar.T6 and dMaxMat5 and tMhPar.T6 > dMaxMat5 then
|
|
dNumLog = -1788
|
|
dNumMessage = 461
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T6), EgtToUiUnits(dMaxMat5))
|
|
tMhPar.T6 = dMaxMat5
|
|
end
|
|
|
|
-- se head mortise concatenata a head face e la profondità della head mortise è maggiore della capacità utensile,
|
|
-- limito la profondità ed emetto un warning
|
|
if not tMhPar.jn6 and tMhPar.T6 and dMaxMat7 and tMhPar.T6 > dMaxMat7 then
|
|
dNumLog = -1787
|
|
dNumMessage = 461
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, EgtToUiUnits(tMhPar.T6), EgtToUiUnits(dMaxMat7))
|
|
tMhPar.T6 = dMaxMat7
|
|
end
|
|
|
|
-- se raggio minore del diametro utensile lo annullo
|
|
if tMhPar.est and tMhPar.rf and tMhPar.rf > 0 and tMhPar.cl > 0 and tMhPar.d and tMhPar.rf < ((tMhPar.d/2)+0.02) then
|
|
tMhPar.rf = 0
|
|
end
|
|
|
|
-- se raggio minore del diametro utensile lo annullo
|
|
if tMhPar.est and tMhPar.rf4 and tMhPar.rf4 > 0 and tMhPar.cl4 > 0 and tMhPar.d4 and tMhPar.rf4 < ((tMhPar.d4/2)+0.02) then
|
|
tMhPar.rf4 = 0
|
|
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
|
|
|
|
if tMhPar.CLC4 and tMhPar.clc4 and tMhPar.clc4 > 0 and ( tMhPar.clc4 >= tMhPar.H4 or tMhPar.clc4 >= tMhPar.L4) then
|
|
tMhPar.clc4 = nil
|
|
elseif not tMhPar.CLC4 then
|
|
tMhPar.clc4 = nil
|
|
end
|
|
|
|
-- setto un valore di poco inferiore allo spessore per non fresare le ventose
|
|
local sPieceName
|
|
if tMhPar.Dws then
|
|
tMhPar.TTP = tMhPar.dThD - DGD.Spd
|
|
if DGD.nTypePz == 3 then sPieceName = 'left Jamb'
|
|
elseif DGD.nTypePz == 4 then sPieceName = 'right Jamb'
|
|
elseif DGD.nTypePz == 5 then sPieceName = 'Frame header'
|
|
else sPieceName = 'Threshold' end
|
|
end
|
|
|
|
-- controllo se le profondità delle geometrie non superano lo spessore frame
|
|
if tMhPar.Dws and DGD.Spd > 0 and tMhPar.T and abs(tMhPar.T) > tMhPar.TTP then
|
|
dNumLog = -1783
|
|
dNumMessage = 681
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sPieceName, 'T', EgtToUiUnits(tMhPar.T), EgtToUiUnits(tMhPar.TTP), EgtToUiUnits(tMhPar.dThD))
|
|
tMhPar.T = tMhPar.TTP
|
|
end
|
|
if tMhPar.Dws and DGD.Spd > 0 and tMhPar.T2 and abs(tMhPar.T2) > tMhPar.TTP then
|
|
dNumLog = -1783
|
|
dNumMessage = 681
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sPieceName, 'T2', EgtToUiUnits(tMhPar.T2), EgtToUiUnits(tMhPar.TTP), EgtToUiUnits(tMhPar.dThD))
|
|
tMhPar.T2 = tMhPar.TTP
|
|
end
|
|
if tMhPar.Dws and DGD.Spd > 0 and tMhPar.T3 and abs(tMhPar.T3) > tMhPar.TTP then
|
|
dNumLog = -1783
|
|
dNumMessage = 681
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sPieceName, 'T3', EgtToUiUnits(tMhPar.T3), EgtToUiUnits(tMhPar.TTP), EgtToUiUnits(tMhPar.dThD))
|
|
tMhPar.T3 = tMhPar.TTP
|
|
end
|
|
if tMhPar.Dws and DGD.Spd > 0 and tMhPar.T4 and abs(tMhPar.T4) > tMhPar.TTP then
|
|
dNumLog = -1783
|
|
dNumMessage = 681
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sPieceName, 'T4', EgtToUiUnits(tMhPar.T4), EgtToUiUnits(tMhPar.TTP), EgtToUiUnits(tMhPar.dThD))
|
|
tMhPar.T4 = tMhPar.TTP
|
|
end
|
|
if tMhPar.Dws and DGD.Spd > 0 and tMhPar.T6 and abs(tMhPar.T6) > tMhPar.TTP then
|
|
dNumLog = -1783
|
|
dNumMessage = 681
|
|
sMessToOut = sMessToOut .. '\n'.. string.format(EgtDoorsMsg[dNumMessage], dNumLog, tMhPar.Nome, sPieceName, 'T6', EgtToUiUnits(tMhPar.T6), EgtToUiUnits(tMhPar.TTP), EgtToUiUnits(tMhPar.dThD))
|
|
tMhPar.T6 = tMhPar.TTP
|
|
end
|
|
end
|
|
|
|
-- 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 parametro step o è 0 lo assegno uguale allo spessore cava
|
|
if not tMhPar.sf4 or abs(tMhPar.sf4) < GEO.EPS_SMALL then
|
|
tMhPar.sf4 = tMhPar.T4
|
|
end
|
|
-- se non ho parametro step o è 0 lo assegno uguale allo spessore cava
|
|
if not tMhPar.s6 or abs(tMhPar.s6) < GEO.EPS_SMALL then
|
|
tMhPar.s6 = tMhPar.T6
|
|
end
|
|
|
|
if dNumLog ~= 0 then
|
|
return tMhPar, dNumLog, sMessToOut
|
|
end
|
|
|
|
return tMhPar, 0, ''
|
|
end
|
|
|
|
-- Funzione di disegno
|
|
function FlushBolt.Draw( tLckP, bPreview, bRunByCompo, nDrawMach, dThickDoor)
|
|
|
|
-- Assegno le dimensioni geometrie di fianco e di testa
|
|
local L = tLckP.L
|
|
local H = tLckP.H
|
|
local T = tLckP.T
|
|
local d = tLckP.d
|
|
local d7 = tLckP.d7
|
|
local p = tLckP.p
|
|
local d6 = tLckP.d6
|
|
local cl = tLckP.cl
|
|
local rf = tLckP.rf
|
|
local clc = tLckP.clc
|
|
local ccr = tLckP.ccr
|
|
local sf = tLckP.sf
|
|
local dl = tLckP.dl
|
|
local mh = tLckP.mh
|
|
local L2 = tLckP.L2
|
|
local H2 = tLckP.H2
|
|
local T2 = tLckP.T2
|
|
local d2 = tLckP.d2
|
|
local p2 = tLckP.p2
|
|
local s = tLckP.s
|
|
local H3 = tLckP.H3
|
|
local T3 = tLckP.T3
|
|
local DB_X = tLckP.DB_X -- posizionamento centro foro rispetto angolo porta
|
|
local L4 = tLckP.L4
|
|
local H4 = tLckP.H4
|
|
local T4 = tLckP.T4
|
|
local d4 = tLckP.d4
|
|
local p4 = tLckP.p4
|
|
local sf4 = tLckP.sf4
|
|
local cl4 = tLckP.cl4
|
|
local rf4 = tLckP.rf4
|
|
local clc4 = tLckP.clc4
|
|
local ccr4 = tLckP.ccr4
|
|
local mc = tLckP.mc
|
|
local d5 = tLckP.d5
|
|
local ech = tLckP.ech
|
|
local ech4 = tLckP.ech4
|
|
local est = tLckP.est -- altro materiale trovato
|
|
local kbs = tLckP.kbs -- keep backset/thickness (0: none, 1: only face, 2: all)
|
|
local pbs = tLckP.pbs
|
|
local SL = tLckP.SL
|
|
local SD = tLckP.SD
|
|
local L6 = tLckP.L6
|
|
local H6 = tLckP.H6
|
|
local T6 = tLckP.T6
|
|
local d6 = tLckP.d6
|
|
local p6 = tLckP.p6
|
|
local s6 = tLckP.s6
|
|
local dws = tLckP.Dws
|
|
local dthd = tLckP.dThD
|
|
local ttp = tLckP.TTP
|
|
-- gestione inversione percorsi
|
|
local invG = tLckP.invG -- flag per invertire il senso dei percorsi di lavorazione
|
|
-- Assegno i flag
|
|
local jn = tLckP.jn -- flag per giunzione face con mortasa
|
|
local jnb = tLckP.jnb -- flag che indica se profilo tipo bevel o meno
|
|
local jn6 = tLckP.jn6 -- flag per giunzione head face con head mortasa
|
|
-- Inserimento geometrie probe
|
|
local posh = tLckP.posh -- posizione in Y del foro di tastatura
|
|
local posp = tLckP.posp -- posizione in X del foro di tastatura
|
|
-- Disassamento della mortise rispetto alla face
|
|
local D_X = tLckP.D_X -- disassamento cava (mortasa o foro) da centro lunghezza face
|
|
local DF_X = tLckP.DF_X -- disassamento cava di testa rispetto a foro di testa
|
|
local DM_X = tLckP.DM_X -- disassamento cava (head mortise) da centro lunghezza head face
|
|
local D_XE = tLckP.D_XE -- disassamento geometrie sul fianco
|
|
-- Assegno le label degli attributi fianco porta
|
|
local LG = tLckP.LG
|
|
local LG2 = tLckP.LG2
|
|
local LM = tLckP.LM
|
|
local LA = tLckP.LA
|
|
local CLC = tLckP.CLC -- nome geometria clean corner
|
|
-- Assegno le label alla geometria foro profondo di lato
|
|
local LGH = tLckP.LGH
|
|
-- Assegno le label alla geometria foro profondo di testa
|
|
local LG3 = tLckP.LG3
|
|
-- Assegno le label degli attributi testa porta
|
|
local LG4 = tLckP.LG4
|
|
local LM4 = tLckP.LM4
|
|
local LM5 = tLckP.LM5
|
|
local LG6 = tLckP.LG6
|
|
local LM6 = tLckP.LM6
|
|
local LM7 = tLckP.LM7
|
|
local CLC4 = tLckP.CLC4 -- nome geometria clean corner
|
|
|
|
local CH = tLckP.CH -- nome suffisso lavorazione chisel
|
|
local DM = 'DUMMY' -- usato per i cerchi di anteprima
|
|
local LH = 'Shuttle_Probe' -- variabile nome geometrie probe
|
|
-- Anti-splint su extra rectangle geometry
|
|
local EAR = tLckP.EAR
|
|
local das = tLckP.das
|
|
local ASG = tLckP.ASG
|
|
-- Second anti-splint on extra rectangle geometry
|
|
local das2 = tLckP.das2
|
|
local ASGR = tLckP.ASGR
|
|
-- tabelle per i fori, rettangoli e linee opzionali
|
|
local tExtraBore = {}
|
|
local tExtraRect = {}
|
|
local tExtraLine = {}
|
|
local tExtraSHBore = {}
|
|
-- inserimento dati nella tabella fori
|
|
table.insert( tExtraBore, { tLckP.D10, tLckP.T10, tLckP.PX10, tLckP.PY10, tLckP.EB10, tLckP.RBS10})
|
|
table.insert( tExtraBore, { tLckP.D11, tLckP.T11, tLckP.PX11, tLckP.PY11, tLckP.EB11, tLckP.RBS11})
|
|
table.insert( tExtraBore, { tLckP.D12, tLckP.T12, tLckP.PX12, tLckP.PY12, tLckP.EB12, tLckP.RBS12})
|
|
table.insert( tExtraBore, { tLckP.D13, tLckP.T13, tLckP.PX13, tLckP.PY13, tLckP.EB13, tLckP.RBS13})
|
|
table.insert( tExtraBore, { tLckP.D14, tLckP.T14, tLckP.PX14, tLckP.PY14, tLckP.EB14, tLckP.RBS14})
|
|
table.insert( tExtraBore, { tLckP.D15, tLckP.T15, tLckP.PX15, tLckP.PY15, tLckP.EB15, tLckP.RBS15})
|
|
table.insert( tExtraBore, { tLckP.D16, tLckP.T16, tLckP.PX16, tLckP.PY16, tLckP.EB16, tLckP.RBS16})
|
|
table.insert( tExtraBore, { tLckP.D17, tLckP.T17, tLckP.PX17, tLckP.PY17, tLckP.EB17, tLckP.RBS17})
|
|
table.insert( tExtraBore, { tLckP.D18, tLckP.T18, tLckP.PX18, tLckP.PY18, tLckP.EB18, tLckP.RBS18})
|
|
table.insert( tExtraBore, { tLckP.D19, tLckP.T19, tLckP.PX19, tLckP.PY19, tLckP.EB19, tLckP.RBS19})
|
|
-- inserimento dati nella tabella rettangoli
|
|
table.insert( tExtraRect, { tLckP.LR10, tLckP.WR10, tLckP.RR10, tLckP.TR10, tLckP.PRX10, tLckP.PRY10, tLckP.AR10, tLckP.ER10, tLckP.RRS10})
|
|
table.insert( tExtraRect, { tLckP.LR11, tLckP.WR11, tLckP.RR11, tLckP.TR11, tLckP.PRX11, tLckP.PRY11, tLckP.AR11, tLckP.ER11, tLckP.RRS11})
|
|
table.insert( tExtraRect, { tLckP.LR12, tLckP.WR12, tLckP.RR12, tLckP.TR12, tLckP.PRX12, tLckP.PRY12, tLckP.AR12, tLckP.ER12, tLckP.RRS12})
|
|
table.insert( tExtraRect, { tLckP.LR13, tLckP.WR13, tLckP.RR13, tLckP.TR13, tLckP.PRX13, tLckP.PRY13, tLckP.AR13, tLckP.ER13, tLckP.RRS13})
|
|
table.insert( tExtraRect, { tLckP.LR14, tLckP.WR14, tLckP.RR14, tLckP.TR14, tLckP.PRX14, tLckP.PRY14, tLckP.AR14, tLckP.ER14, tLckP.RRS14})
|
|
-- inserimento dati nella tabella linee
|
|
table.insert( tExtraLine, { tLckP.LL10, tLckP.TL10, tLckP.PLX10, tLckP.PLY10, tLckP.AL10, tLckP.EL10, tLckP.RLS10})
|
|
table.insert( tExtraLine, { tLckP.LL11, tLckP.TL11, tLckP.PLX11, tLckP.PLY11, tLckP.AL11, tLckP.EL11, tLckP.RLS11})
|
|
table.insert( tExtraLine, { tLckP.LL12, tLckP.TL12, tLckP.PLX12, tLckP.PLY12, tLckP.AL12, tLckP.EL12, tLckP.RLS12})
|
|
table.insert( tExtraLine, { tLckP.LL13, tLckP.TL13, tLckP.PLX13, tLckP.PLY13, tLckP.AL13, tLckP.EL13, tLckP.RLS13})
|
|
table.insert( tExtraLine, { tLckP.LL14, tLckP.TL14, tLckP.PLX14, tLckP.PLY14, tLckP.AL14, tLckP.EL14, tLckP.RLS14})
|
|
-- inserimento dati nella tabella fori
|
|
table.insert( tExtraBore, { tLckP.D20, tLckP.T20, tLckP.PX20, tLckP.PY20, tLckP.EB20, tLckP.RBS20})
|
|
table.insert( tExtraBore, { tLckP.D21, tLckP.T21, tLckP.PX21, tLckP.PY21, tLckP.EB21, tLckP.RBS21})
|
|
table.insert( tExtraBore, { tLckP.D22, tLckP.T22, tLckP.PX22, tLckP.PY22, tLckP.EB22, tLckP.RBS22})
|
|
table.insert( tExtraBore, { tLckP.D23, tLckP.T23, tLckP.PX23, tLckP.PY23, tLckP.EB23, tLckP.RBS23})
|
|
table.insert( tExtraBore, { tLckP.D24, tLckP.T24, tLckP.PX24, tLckP.PY24, tLckP.EB24, tLckP.RBS24})
|
|
table.insert( tExtraBore, { tLckP.D25, tLckP.T25, tLckP.PX25, tLckP.PY25, tLckP.EB25, tLckP.RBS25})
|
|
table.insert( tExtraBore, { tLckP.D26, tLckP.T26, tLckP.PX26, tLckP.PY26, tLckP.EB26, tLckP.RBS26})
|
|
table.insert( tExtraBore, { tLckP.D27, tLckP.T27, tLckP.PX27, tLckP.PY27, tLckP.EB27, tLckP.RBS27})
|
|
table.insert( tExtraBore, { tLckP.D28, tLckP.T28, tLckP.PX28, tLckP.PY28, tLckP.EB28, tLckP.RBS28})
|
|
table.insert( tExtraBore, { tLckP.D29, tLckP.T29, tLckP.PX29, tLckP.PY29, tLckP.EB29, tLckP.RBS29})
|
|
-- inserimento dati nella tabella rettangoli
|
|
table.insert( tExtraRect, { tLckP.LR20, tLckP.WR20, tLckP.RR20, tLckP.TR20, tLckP.PRX20, tLckP.PRY20, tLckP.AR20, tLckP.ER20, tLckP.RRS20})
|
|
table.insert( tExtraRect, { tLckP.LR21, tLckP.WR21, tLckP.RR21, tLckP.TR21, tLckP.PRX21, tLckP.PRY21, tLckP.AR21, tLckP.ER21, tLckP.RRS21})
|
|
table.insert( tExtraRect, { tLckP.LR22, tLckP.WR22, tLckP.RR22, tLckP.TR22, tLckP.PRX22, tLckP.PRY22, tLckP.AR22, tLckP.ER22, tLckP.RRS22})
|
|
table.insert( tExtraRect, { tLckP.LR23, tLckP.WR23, tLckP.RR23, tLckP.TR23, tLckP.PRX23, tLckP.PRY23, tLckP.AR23, tLckP.ER23, tLckP.RRS23})
|
|
table.insert( tExtraRect, { tLckP.LR24, tLckP.WR24, tLckP.RR24, tLckP.TR24, tLckP.PRX24, tLckP.PRY24, tLckP.AR24, tLckP.ER24, tLckP.RRS24})
|
|
-- inserimento dati nella tabella linee
|
|
table.insert( tExtraLine, { tLckP.LL20, tLckP.TL20, tLckP.PLX20, tLckP.PLY20, tLckP.AL20, tLckP.EL20, tLckP.RLS20})
|
|
table.insert( tExtraLine, { tLckP.LL21, tLckP.TL21, tLckP.PLX21, tLckP.PLY21, tLckP.AL21, tLckP.EL21, tLckP.RLS21})
|
|
table.insert( tExtraLine, { tLckP.LL22, tLckP.TL22, tLckP.PLX22, tLckP.PLY22, tLckP.AL22, tLckP.EL22, tLckP.RLS22})
|
|
table.insert( tExtraLine, { tLckP.LL23, tLckP.TL23, tLckP.PLX23, tLckP.PLY23, tLckP.AL23, tLckP.EL23, tLckP.RLS23})
|
|
table.insert( tExtraLine, { tLckP.LL24, tLckP.TL24, tLckP.PLX24, tLckP.PLY24, tLckP.AL24, tLckP.EL24, tLckP.RLS24})
|
|
-- inserimento dati nella tabella fori di lato
|
|
table.insert( tExtraSHBore, { tLckP.D30, tLckP.T30, tLckP.I30, tLckP.PX30, tLckP.PY30, tLckP.EB30, tLckP.HB30})
|
|
table.insert( tExtraSHBore, { tLckP.D31, tLckP.T31, tLckP.I31, tLckP.PX31, tLckP.PY31, tLckP.EB31, tLckP.HB31})
|
|
table.insert( tExtraSHBore, { tLckP.D32, tLckP.T32, tLckP.I32, tLckP.PX32, tLckP.PY32, tLckP.EB32, tLckP.HB32})
|
|
table.insert( tExtraSHBore, { tLckP.D33, tLckP.T33, tLckP.I33, tLckP.PX33, tLckP.PY33, tLckP.EB33, tLckP.HB33})
|
|
table.insert( tExtraSHBore, { tLckP.D34, tLckP.T34, tLckP.I34, tLckP.PX34, tLckP.PY34, tLckP.EB34, tLckP.HB34})
|
|
table.insert( tExtraSHBore, { tLckP.D35, tLckP.T35, tLckP.I35, tLckP.PX35, tLckP.PY35, tLckP.EB35, tLckP.HB35})
|
|
table.insert( tExtraSHBore, { tLckP.D36, tLckP.T36, tLckP.I36, tLckP.PX36, tLckP.PY36, tLckP.EB36, tLckP.HB36})
|
|
table.insert( tExtraSHBore, { tLckP.D37, tLckP.T37, tLckP.I37, tLckP.PX37, tLckP.PY37, tLckP.EB37, tLckP.HB37})
|
|
table.insert( tExtraSHBore, { tLckP.D38, tLckP.T38, tLckP.I38, tLckP.PX38, tLckP.PY38, tLckP.EB38, tLckP.HB38})
|
|
table.insert( tExtraSHBore, { tLckP.D39, tLckP.T39, tLckP.I39, tLckP.PX39, tLckP.PY39, tLckP.EB39, tLckP.HB39})
|
|
-- inserimento dati nella tabella fori di testa
|
|
table.insert( tExtraSHBore, { tLckP.D40, tLckP.T40, tLckP.I40, tLckP.PX40, tLckP.PY40, tLckP.EB40})
|
|
table.insert( tExtraSHBore, { tLckP.D41, tLckP.T41, tLckP.I41, tLckP.PX41, tLckP.PY41, tLckP.EB41})
|
|
table.insert( tExtraSHBore, { tLckP.D42, tLckP.T42, tLckP.I42, tLckP.PX42, tLckP.PY42, tLckP.EB42})
|
|
table.insert( tExtraSHBore, { tLckP.D43, tLckP.T43, tLckP.I43, tLckP.PX43, tLckP.PY43, tLckP.EB43})
|
|
table.insert( tExtraSHBore, { tLckP.D44, tLckP.T44, tLckP.I44, tLckP.PX44, tLckP.PY44, tLckP.EB44})
|
|
|
|
-- variabili per messaggi e settaggi vari
|
|
local sCompoName = tLckP.Nome
|
|
local nCompoNpar = tLckP.Npar
|
|
local sCompoPath = tLckP.Path
|
|
-- eventuale messaggio errore rilevato nell'adjust
|
|
local nCodAdj = tLckP.nCod
|
|
local sCodAdj = tLckP.sCod
|
|
-- variabili per messaggi di errore
|
|
local sNamePar1 = tLckP.NPL or 'L'
|
|
local sNamePar2 = tLckP.NPH or 'H'
|
|
local sNamePar3 = tLckP.NPT or 'T'
|
|
local sNamePar4 = tLckP.NPd or 'd'
|
|
local sNamePar5 = tLckP.NPp or 'p'
|
|
local sNamePar7 = tLckP.NL2 or 'L2'
|
|
local sNamePar8 = tLckP.NT2 or 'T2'
|
|
local sNamePar9 = tLckP.NPd2 or 'd2'
|
|
local sNamePar10 = tLckP.NPp2 or 'p2'
|
|
local sNamePar11 = tLckP.NPS or 's'
|
|
local sNamePar47 = tLckP.NPH2 or 'H2'
|
|
local sNamePar48 = tLckP.NPSF or 'sf'
|
|
local sNamePar49 = tLckP.NPSF4 or 'sf4'
|
|
local sNamePar12 = tLckP.NPH3 or 'H3'
|
|
local sNamePar13 = tLckP.NPT3 or 'T3'
|
|
local sNamePar14 = tLckP.NPDBX or 'DB_X'
|
|
local sNamePar15 = tLckP.NPL4 or 'L4'
|
|
local sNamePar16 = tLckP.NPH4 or 'H4'
|
|
local sNamePar17 = tLckP.NPT4 or 'T4'
|
|
local sNamePar18 = tLckP.NPd4 or 'd4'
|
|
local sNamePar19 = tLckP.NPp4 or 'p4'
|
|
local sNamePar20 = tLckP.NPDFX or 'DF_X'
|
|
local sNamePar21 = tLckP.NPd5 or 'd5'
|
|
local sNamePar22 = tLckP.NPrf or 'rf'
|
|
local sNamePar23 = tLckP.NPrf4 or 'rf4'
|
|
local sNamePar24 = tLckP.NPL6 or 'L6'
|
|
local sNamePar25 = tLckP.NPH6 or 'H6'
|
|
local sNamePar26 = tLckP.NPT6 or 'T6'
|
|
local sNamePar27 = tLckP.NPd6 or 'd6'
|
|
local sNamePar28 = tLckP.NPp6 or 'p6'
|
|
local sNamePar29 = tLckP.NPS6 or 's6'
|
|
local sNamePar30 = tLckP.NPDX or 'D_X'
|
|
local sNamePar31 = tLckP.NPDMX or 'DM_X'
|
|
local sNamePar32 = tLckP.NPd7 or 'd7'
|
|
local sNamePar33 = tLckP.N33 or 'clc'
|
|
local sNamePar34 = tLckP.N34 or 'ccr'
|
|
local sNamePar35 = tLckP.N35 or 'clc4'
|
|
local sNamePar36 = tLckP.N36 or 'ccr4'
|
|
|
|
-- RunByComponetInterface
|
|
local RC = true
|
|
-- Messaggi codice errori
|
|
local EM = ' '
|
|
local EC = 0
|
|
local ErrorBase = 1700
|
|
-- variabili che abilitano la creazione della geometria
|
|
local bMakeFaceGeom = true
|
|
local bMakeMortGeom = true
|
|
local bMakeBoreGeom = true
|
|
local bMake2ndFaceGeom = true
|
|
local bMakeASFaceGeom = true
|
|
local bMakeAS2ndFaceGeom = true
|
|
local bMake2ndMortGeom = true
|
|
local bStrike2ndFaceGeom
|
|
|
|
-- verifico se dei parametri sono nulli e in qual caso assegno dei valori sostitutivi
|
|
if not L or not H then
|
|
bMakeFaceGeom = false
|
|
jn = false -- disattivo il join tra face e mortasa
|
|
clc = nil
|
|
CLC = nil
|
|
end
|
|
|
|
-- se le dimensioni del raccordo sono eccessive le riconduco a valori accettabili
|
|
if bMakeFaceGeom then
|
|
if L >= H then
|
|
if rf > (H/2) then
|
|
rf = (H/2)
|
|
end
|
|
else
|
|
if rf > (L/2) then
|
|
rf = (L/2)
|
|
end
|
|
end
|
|
end
|
|
|
|
-- se tipo extension disattivo l'antisplint fu side face
|
|
if not mc or not bMakeFaceGeom then
|
|
bMakeASFaceGeom = false
|
|
end
|
|
|
|
if not bRunByCompo then RC = false end
|
|
if not T then T = 0 end
|
|
if not T2 then T2 = 0 end
|
|
if not D_X then D_X = 0 end
|
|
if not DB_X then DB_X = 0 end
|
|
if not DF_X then DF_X = 0 end
|
|
if not DM_X then DM_X = 0 end
|
|
|
|
-- se rilevato profilo bevel disattivo il join tra face e mortasa
|
|
if not jnb then jn = 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
|
|
|
|
-- se rilevato tipo corner disattivo il foro
|
|
if mc or not H3 or not T3 or not LG3 then bMakeBoreGeom = false end
|
|
|
|
-- se parametri face di testa mancanti
|
|
if not L4 or not H4 or not T4 then
|
|
bMake2ndFaceGeom = false
|
|
jn6 = false -- disattivo il join tra face e mortasa
|
|
clc4 = nil
|
|
CLC4 = nil
|
|
end
|
|
-- se parametri mortise di testa mancanti
|
|
if not L6 or not H6 or not T6 then
|
|
bMake2ndMortGeom = false
|
|
jn6 = false -- disattivo il join tra face e mortasa
|
|
end
|
|
|
|
-- se le dimensioni del raccordo sono eccessive le riconduco a valori accettabili
|
|
if bMake2ndFaceGeom then
|
|
if L4 >= H4 then
|
|
if rf4 > (H4/2) then
|
|
rf4 = (H4/2)
|
|
end
|
|
else
|
|
if rf4 > (L4/2) then
|
|
rf4 = (L4/2)
|
|
end
|
|
end
|
|
end
|
|
|
|
-- se tipo extension con cava top/bottom e cava non sconfinante disattivo la creazione dell'antischeggia
|
|
if not mc and bMake2ndFaceGeom and ( DB_X + DF_X - (L4/2)) > 0 then bMakeAS2ndFaceGeom = false end
|
|
|
|
-- se tipo extension con cava top/bottom e cava sconfinante risistemo la lunghezza cava e gli eventuali arrotondamenti
|
|
if not mc and bMake2ndFaceGeom and ( DB_X + DF_X - (L4/2)) < 0 then
|
|
L4 = L4/2 + DB_X + DF_X
|
|
if cl4 > 1 then -- se arrotondamento a destra o entrambe
|
|
cl4 = cl4 - 2 -- se 2 ( solo destra) diventa 0 (nessuno), se 3 (entrambe) diventa 1 ( solo sinistra)
|
|
end
|
|
bStrike2ndFaceGeom = true
|
|
end
|
|
|
|
if mh then -- se foro orizzontale
|
|
if not H2 then
|
|
bMakeMortGeom = false
|
|
end
|
|
-- disattivo il join
|
|
jn = false
|
|
else
|
|
if not L2 or not H2 then
|
|
bMakeMortGeom = false
|
|
-- disattivo il join
|
|
jn = false
|
|
end
|
|
end
|
|
|
|
if est then
|
|
bMakeMortGeom = false
|
|
bMakeASFaceGeom = false
|
|
bMakeAS2ndFaceGeom = false
|
|
bMake2ndMortGeom = false
|
|
end
|
|
|
|
-- se prima e seconda cava giuntate assegno il diametro della seconda cava uguale alla prima
|
|
if jn and bMakeFaceGeom and bMakeMortGeom then
|
|
d2 = d
|
|
p2 = p
|
|
end
|
|
|
|
if not ASGR then
|
|
das2 = nil
|
|
end
|
|
|
|
local EgtDoorsMsg = require( 'EgtDoorsMsg')
|
|
|
|
-- Verifica delle dimensioni, alcune condizioni vengono verificate solo se è abilitata la creazione dei percorsi di lavorazione
|
|
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 bMakeMortGeom and nDrawMach > 0 and not mh and d2 < DgMin then
|
|
EC = 2
|
|
EM = string.format(EgtDoorsMsg[400],sNamePar9, EgtToUiUnits(d),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
|
|
d2 = DgMin
|
|
elseif bMakeFaceGeom and nDrawMach > 0 and H < d then
|
|
if DGD.bProoduce then
|
|
EC = 3
|
|
EM = string.format(EgtDoorsMsg[405],sNamePar2,EgtToUiUnits(H),EgtToUiUnits(d), sCompoPath) -- il parametro 'H' deve essere >= del diametro utensile
|
|
H = d
|
|
else
|
|
d = H - 0.002
|
|
end
|
|
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
|
|
L = d + 0.002
|
|
else
|
|
d = L - 0.002
|
|
end
|
|
elseif bMakeFaceGeom and nDrawMach > 0 and ( p < PtMin or p > PtMax) then
|
|
EC = 5
|
|
EM = string.format(EgtDoorsMsg[403],sNamePar5,p,PtMin,PtMax, sCompoPath) -- il parametro 'p' deve essere compreso tra
|
|
p = 0.8
|
|
elseif bMakeMortGeom and nDrawMach > 0 and not mh and ( p2 < PtMin or p2 > PtMax) then
|
|
EC = 6
|
|
EM = string.format(EgtDoorsMsg[403],sNamePar10,p2,PtMin,PtMax, sCompoPath) -- il parametro 'p2' deve essere compreso tra
|
|
p2 = 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*2
|
|
elseif bMakeFaceGeom and bMakeMortGeom and not mh and L2 and L and L2 >= L then
|
|
EC = 9
|
|
EM = string.format(EgtDoorsMsg[406],sNamePar7,EgtToUiUnits(L2),sNamePar1,EgtToUiUnits(L), sCompoPath) -- il parametro 'L2' deve essere < 'L'
|
|
L2 = L - 0.1
|
|
elseif jn and D_X > ((L-L2)/2) then
|
|
EC = 10
|
|
EM = string.format(EgtDoorsMsg[423],sNamePar30,EgtToUiUnits(D_X),EgtToUiUnits((L-L2)/2), sCompoPath) -- il parametro 'D_X' é troppo grande, max valore:
|
|
D_X = 0
|
|
elseif bMakeFaceGeom and bMakeMortGeom and H2 > H then
|
|
EC = 11
|
|
EM = string.format(EgtDoorsMsg[456],sNamePar47,EgtToUiUnits(H2),sNamePar2,EgtToUiUnits(H), sCompoPath) -- il parametro 'H2' deve essere <= 'H'
|
|
H2 = H
|
|
elseif bMakeMortGeom and T2 <= 0 then
|
|
EC = 12
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar8,EgtToUiUnits(T2), sCompoPath) -- il parametro 'T2' deve essere > 0
|
|
T2 = 0.1
|
|
elseif bMakeFaceGeom and bMakeMortGeom and not dws and T2 <= T then
|
|
EC = 13
|
|
EM = string.format(EgtDoorsMsg[407],sNamePar8,EgtToUiUnits(T2),sNamePar3,EgtToUiUnits(T), sCompoPath) -- il parametro 'T2' deve essere > 'T'
|
|
T2 = T + 0.1
|
|
elseif bMakeMortGeom and nDrawMach > 0 and not mh and s and s <= 0 then
|
|
EC = 14
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar11,EgtToUiUnits(s), sCompoPath) -- il parametro 's' deve essere > 0
|
|
s = d2
|
|
elseif bMakeMortGeom and nDrawMach > 0 and not mh and L2 and L2 <= d2 then
|
|
if DGD.bProoduce then
|
|
EC = 15
|
|
EM = string.format(EgtDoorsMsg[402],sNamePar7,EgtToUiUnits(L2),sNamePar9,EgtToUiUnits(d2), sCompoPath) -- il parametro 'L2' deve essere maggiore al diametro utensile
|
|
L2 = d + 0.002
|
|
else
|
|
d = L2 - 0.002
|
|
end
|
|
elseif bMakeMortGeom and nDrawMach > 0 and not mh and H2 and H2 < d2 then
|
|
if DGD.bProoduce then
|
|
EC = 16
|
|
EM = string.format(EgtDoorsMsg[405],sNamePar47,EgtToUiUnits(H2),EgtToUiUnits(d2), sCompoPath) -- il parametro 'H2' deve essere >= del diametro utensile
|
|
H2 = d2
|
|
else
|
|
d2 = H2 - 0.002
|
|
end
|
|
elseif bMakeFaceGeom and H <= 0 then
|
|
EC = 17
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar2,EgtToUiUnits(H), sCompoPath) -- il parametro 'H' deve essere > 0
|
|
H = d
|
|
elseif bMakeMortGeom and H2 <= 0 then
|
|
EC = 18
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar47,EgtToUiUnits(H2), sCompoPath) -- il parametro 'H2' deve essere > 0
|
|
H2 = d2
|
|
elseif bMakeFaceGeom and nDrawMach > 0 and sf and sf <= 0 then
|
|
EC = 19
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar48,EgtToUiUnits(sf), sCompoPath) -- il parametro 'sf' deve essere > 0
|
|
sf = d
|
|
elseif bMake2ndFaceGeom and nDrawMach > 0 and d4 < DgMin then
|
|
EC = 20
|
|
EM = string.format(EgtDoorsMsg[400],sNamePar18, EgtToUiUnits(d4),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
|
|
d4 = DgMin
|
|
elseif bMake2ndFaceGeom and bMakeAS2ndFaceGeom and nDrawMach > 0 and d5 and d5 < DgMin then
|
|
EC = 21
|
|
EM = string.format(EgtDoorsMsg[400],sNamePar21, EgtToUiUnits(d5),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
|
|
d5 = DgMin
|
|
elseif bMake2ndFaceGeom and nDrawMach > 0 and H4 < d4 then
|
|
if DGD.bProoduce then
|
|
EC = 22
|
|
EM = string.format(EgtDoorsMsg[405],sNamePar16,EgtToUiUnits(H4),EgtToUiUnits(d4), sCompoPath) -- il parametro 'H4' deve essere >= del diametro utensile
|
|
H4 = d4
|
|
else
|
|
d4 = H4 - 0.002
|
|
end
|
|
elseif bMake2ndFaceGeom and nDrawMach > 0 and L4 <= d4 then
|
|
if DGD.bProoduce then
|
|
EC = 23
|
|
EM = string.format(EgtDoorsMsg[402],sNamePar15,EgtToUiUnits(L4),sNamePar18,EgtToUiUnits(d4), sCompoPath) -- il parametro 'L4' deve essere maggiore al diametro utensile
|
|
L4 = d4 + 0.002
|
|
else
|
|
d4 = L4 - 0.002
|
|
end
|
|
elseif bMake2ndFaceGeom and nDrawMach > 0 and ( p4 < PtMin or p4 > PtMax) then
|
|
EC = 24
|
|
EM = string.format(EgtDoorsMsg[403],sNamePar19,p4,PtMin,PtMax, sCompoPath) -- il parametro 'p4' deve essere compreso tra
|
|
p4 = 0.8
|
|
elseif bMake2ndFaceGeom and T4 < 0 then
|
|
EC = 25
|
|
EM = string.format(EgtDoorsMsg[404],sNamePar17,EgtToUiUnits(T4), sCompoPath) -- il parametro 'T4' deve essere >= 0
|
|
T4 = 0
|
|
elseif bMake2ndFaceGeom and L4 <= 0 then
|
|
EC = 26
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar15,EgtToUiUnits(L4), sCompoPath) -- il parametro 'L4' deve essere > 0
|
|
L4 = d*2
|
|
-- elseif bMake2ndFaceGeom and bMakeBoreGeom and H3 > H4 then
|
|
-- EC = 27
|
|
-- EM = string.format(EgtDoorsMsg[456],sNamePar12,EgtToUiUnits(H3),sNamePar16,EgtToUiUnits(H4), sCompoPath) -- il parametro 'H3' deve essere <= 'H4'
|
|
-- H3 = H4
|
|
elseif bMake2ndFaceGeom and bMakeAS2ndFaceGeom and nDrawMach > 0 and d5 and H4 < d5 then
|
|
if DGD.bProoduce then
|
|
EC = 28
|
|
EM = string.format(EgtDoorsMsg[405],sNamePar16,EgtToUiUnits(H4),EgtToUiUnits(d5), sCompoPath) -- il parametro 'H4' deve essere >= del diametro utensile
|
|
H4 = d5
|
|
else
|
|
d5 = H4 - 0.002
|
|
end
|
|
-- elseif bMakeBoreGeom and DB_X <= H3/2 then
|
|
-- EC = 29
|
|
-- EM = string.format(EgtDoorsMsg[407],sNamePar14,EgtToUiUnits(DB_X),sNamePar12..'/2',EgtToUiUnits(H3/2), sCompoPath) -- il parametro 'DB_X' deve essere > 'H3/2'
|
|
-- DB_X = H3/2 + 0.1
|
|
elseif bMake2ndFaceGeom and nDrawMach > 0 and sf4 and sf4 <= 0 then
|
|
EC = 30
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar49,EgtToUiUnits(sf4), sCompoPath) -- il parametro 'sf4' deve essere > 0
|
|
sf4 = d
|
|
elseif bMakeFaceGeom and cl and cl > 0 and rf < 0 then
|
|
EC = 31
|
|
EM = string.format(EgtDoorsMsg[404],sNamePar22,EgtToUiUnits(rf), sCompoPath) -- il parametro 'rf' deve essere >= 0
|
|
rf = H/2
|
|
elseif bMake2ndFaceGeom and cl4 and cl4 > 0 and rf4 < 0 then
|
|
EC = 32
|
|
EM = string.format(EgtDoorsMsg[404],sNamePar23,EgtToUiUnits(rf4), sCompoPath) -- il parametro 'rf4' deve essere >= 0
|
|
rf4 = H4/2
|
|
elseif bMake2ndMortGeom and nDrawMach > 0 and not jn6 and d6 < DgMin then
|
|
EC = 33
|
|
EM = string.format(EgtDoorsMsg[400],sNamePar27, EgtToUiUnits(d6),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
|
|
d6 = DgMin
|
|
elseif bMake2ndMortGeom and nDrawMach > 0 and not jn6 and H6 < d6 then
|
|
if DGD.bProoduce then
|
|
EC = 34
|
|
EM = string.format(EgtDoorsMsg[405],sNamePar25,EgtToUiUnits(H6),EgtToUiUnits(d6), sCompoPath) -- il parametro 'H6' deve essere >= del diametro utensile
|
|
H6 = d6
|
|
else
|
|
d6 = H6 - 0.002
|
|
end
|
|
elseif nDrawMach > 0 and jn6 and H6 < d4 then
|
|
if DGD.bProoduce then
|
|
EC = 35
|
|
EM = string.format(EgtDoorsMsg[405],sNamePar25,EgtToUiUnits(H6),EgtToUiUnits(d4), sCompoPath) -- il parametro 'H6' deve essere >= del diametro utensile
|
|
H6 = d4
|
|
else
|
|
d4 = H6 - 0.002
|
|
end
|
|
elseif bMake2ndMortGeom and nDrawMach > 0 and not jn6 and L6 <= d6 then
|
|
if DGD.bProoduce then
|
|
EC = 36
|
|
EM = string.format(EgtDoorsMsg[402],sNamePar24,EgtToUiUnits(L6),sNamePar27,EgtToUiUnits(d6), sCompoPath) -- il parametro 'L6' deve essere maggiore al diametro utensile
|
|
L6 = d6 + 0.002
|
|
else
|
|
d6 = L6 - 0.002
|
|
end
|
|
elseif nDrawMach > 0 and jn6 and L6 <= d4 then
|
|
if DGD.bProoduce then
|
|
EC = 37
|
|
EM = string.format(EgtDoorsMsg[402],sNamePar24,EgtToUiUnits(L6),sNamePar18,EgtToUiUnits(d4), sCompoPath) -- il parametro 'L6' deve essere maggiore al diametro utensile
|
|
L6 = d4 + 0.002
|
|
else
|
|
d4 = L6 - 0.002
|
|
end
|
|
elseif bMake2ndMortGeom and nDrawMach > 0 and not jn6 and ( p6 < PtMin or p6 > PtMax) then
|
|
EC = 38
|
|
EM = string.format(EgtDoorsMsg[403],sNamePar28,p6,PtMin,PtMax, sCompoPath) -- il parametro 'p6' deve essere compreso tra
|
|
p6 = 0.8
|
|
elseif nDrawMach > 0 and jn6 and L6 >= L4 then
|
|
EC = 39
|
|
EM = string.format(EgtDoorsMsg[406],sNamePar24,EgtToUiUnits(L6),sNamePar15,EgtToUiUnits(L4), sCompoPath) -- il parametro 'L6' deve essere < 'L4'
|
|
L6 = L4 - 0.1
|
|
elseif nDrawMach > 0 and jn6 and DM_X > ((L4-L6)/2) then
|
|
EC = 40
|
|
EM = string.format(EgtDoorsMsg[423],sNamePar31,EgtToUiUnits(DM_X),EgtToUiUnits((L4-L6)/2), sCompoPath) -- il parametro 'D_X' é troppo grande, max valore:
|
|
D_X = 0
|
|
elseif nDrawMach > 0 and jn6 and H6 > H4 then
|
|
EC = 41
|
|
EM = string.format(EgtDoorsMsg[456],sNamePar25,EgtToUiUnits(H6),sNamePar16,EgtToUiUnits(H4), sCompoPath) -- il parametro 'H6' deve essere <= 'H4'
|
|
H6 = H4
|
|
elseif nDrawMach > 0 and jn6 and T6 <= T4 then
|
|
EC = 42
|
|
EM = string.format(EgtDoorsMsg[407],sNamePar26,EgtToUiUnits(T6),sNamePar17,EgtToUiUnits(T4), sCompoPath) -- il parametro 'T6' deve essere > 'T4'
|
|
T2 = T + 0.1
|
|
elseif bMake2ndMortGeom and nDrawMach > 0 and not jn6 and s6 and s6 <= 0 then
|
|
EC = 43
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar29,EgtToUiUnits(s6), sCompoPath) -- il parametro 's6' deve essere > 0
|
|
s6 = d6
|
|
elseif bMake2ndMortGeom and T6 < 0 then
|
|
EC = 44
|
|
EM = string.format(EgtDoorsMsg[404],sNamePar26,EgtToUiUnits(T6), sCompoPath) -- il parametro 'T6' deve essere >= 0
|
|
T6 = 0
|
|
elseif bMake2ndMortGeom and L6 <= 0 then
|
|
EC = 45
|
|
EM = string.format(EgtDoorsMsg[401],sNamePar24,EgtToUiUnits(L6), sCompoPath) -- il parametro 'L6' deve essere > 0
|
|
L6 = d*2
|
|
elseif bMakeFaceGeom and bMakeASFaceGeom and nDrawMach > 0 and d7 and d7 < DgMin then
|
|
EC = 46
|
|
EM = string.format(EgtDoorsMsg[400],sNamePar32, EgtToUiUnits(d7),EgtToUiUnits(DgMin)) -- il diametro utensile deve essere >= di
|
|
d5 = DgMin
|
|
elseif bMakeFaceGeom and bMakeASFaceGeom and nDrawMach > 0 and d7 and H < d7 then
|
|
if DGD.bProoduce then
|
|
EC = 47
|
|
EM = string.format(EgtDoorsMsg[405],sNamePar2,EgtToUiUnits(H),EgtToUiUnits(d7), sCompoPath) -- il parametro 'H' deve essere >= del diametro utensile
|
|
H4 = d5
|
|
else
|
|
d5 = H4 - 0.002
|
|
end
|
|
elseif bMakeFaceGeom and CLC and clc and ccr and clc > 0 and ccr > 0 and (2*(ccr*sin(45))) >= clc then
|
|
EC = 48
|
|
EM = string.format(EgtDoorsMsg[407],sNamePar33,EgtToUiUnits(clc),'',EgtToUiUnits(2*(ccr*sin(45))), sCompoPath) -- il parametro 'clc' deve essere > 'crc'
|
|
clc = (2*(ccr*sin(45)))+0.2
|
|
elseif bMake2ndFaceGeom and CLC4 and clc4 and ccr4 and clc4 > 0 and ccr4 > 0 and (2*(ccr4*sin(45))) >= clc4 then
|
|
EC = 49
|
|
EM = string.format(EgtDoorsMsg[407],sNamePar35,EgtToUiUnits(clc4),'',EgtToUiUnits(2*(ccr4*sin(45))), sCompoPath) -- il parametro 'clc4' deve essere > 'crc'
|
|
clc4 = (2*(ccr4*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
|
|
|
|
Lg = EgtGroup(Pz,GDB_RT.LOC) -- layer 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
|
|
|
|
local nPos1st = 0
|
|
local nPos2nd = 0
|
|
local hint, hint_2, hint_3, hint_4, hint_6 -- variabili percorsi principali su fianco
|
|
local hint_10, hint_11, hint_13, hint_14, hint_15 -- variabili percorsi su secure o keyway
|
|
local hintAs, hintAs_4
|
|
local nClc1, nClc2, nClc3, nClc4, nClc1h, nClc2h, nClc3h, nClc4h
|
|
local hintPk, hintPk2, hintPk4, hintPk6 -- variabili percorsi di lavorazione
|
|
local nPkJoin
|
|
local dFirstface = {}
|
|
local dSecondface = {}
|
|
local dFirstMortise = {}
|
|
local dSecondMortise = {}
|
|
local nForceMakeFace = nDrawMach
|
|
|
|
if bMakeFaceGeom then -- se face su fianco abilitata
|
|
|
|
-- in base agli arrotondamenti calcolo lo spostamento per posizionare la cava in centro
|
|
if cl == 1 then -- se arrotondamento a sinistra
|
|
nPos1st = rf/2
|
|
elseif cl == 2 then -- se arrotondamento a destra
|
|
nPos1st = -(rf/2)
|
|
else
|
|
nPos1st = 0
|
|
end
|
|
|
|
-- prima cava face completa
|
|
-- assegno i valori coerenti con la tabella del componente
|
|
dFirstface.L = L
|
|
dFirstface.H = H
|
|
dFirstface.T = T
|
|
dFirstface.d = d
|
|
dFirstface.p = p
|
|
dFirstface.sf = sf
|
|
dFirstface.jn = jn
|
|
dFirstface.L2 = L2
|
|
dFirstface.H2 = H2
|
|
dFirstface.cl = cl
|
|
dFirstface.rf = rf
|
|
dFirstface.est = est
|
|
dFirstface.invG = invG
|
|
if ech then
|
|
dFirstface.LG = LG .. CH
|
|
-- se ho abilitato solo le geometrie di lavorazione, abilito la generazione di entrambe per il contorno chisel
|
|
if nDrawMach == 1 then
|
|
nForceMakeFace = 2
|
|
end
|
|
else
|
|
dFirstface.LG = LG
|
|
end
|
|
dFirstface.LM = LM
|
|
dFirstface.Nome = sCompoName
|
|
-- lancio il componente base per disegnare la face completa
|
|
if mc then -- se tipo corner
|
|
dFirstface.D_X = D_X
|
|
if bMakeASFaceGeom then
|
|
dFirstface.d2 = d7
|
|
dFirstface.LA = LM7
|
|
else
|
|
dFirstface.d2 = nil -- resetto il parametro per antischeggia
|
|
dFirstface.LA = nil -- resetto la label per antischeggia
|
|
end
|
|
MHgen = require( '_LatchCorner')
|
|
else
|
|
dFirstface.D_X = D_X - nPos1st
|
|
MHgen = require( '_Latch')
|
|
end
|
|
dFirstface.Dws = nil -- disabilito per non creare geometrie (doppie) inerenti il calcolo regioni nei componenti chiamati
|
|
hint, hintPk, hintAs = MHgen.Draw( EC, EM, dFirstface, bPreview, bRunByCompo, nForceMakeFace, Pz, Lg, dThickDoor)
|
|
|
|
-- setto le note che indicareno su che lato della porta devono essere messe le geometrie
|
|
local sSide = EgtIf( dl, 'Lock', 'Side')
|
|
|
|
if hint then
|
|
EgtSetInfo(hint,'SideDoor',sSide)
|
|
-- 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
|
|
if hintPk then
|
|
EgtSetInfo(hintPk,'SideDoor',sSide)
|
|
-- se mantiene centro spessore anche su face
|
|
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
|
|
if hintAs then
|
|
EgtSetInfo(hintAs,'SideDoor',sSide)
|
|
-- se mantiene centro spessore anche su face
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( hintAs, '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( hintAs, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
|
|
-- Clean corner on side
|
|
if nDrawMach >= 0 then -- se abilitata geometria
|
|
if cl ~= 3 or ( cl == 3 and rf > 0) then -- se c'è almeno un lato senza raccordo
|
|
if CLC and clc and clc > 0 and clc < H and clc < L then
|
|
|
|
nClc1 = MakeClcPath( clc, ccr, CLC, Lg, -T, (invG == -1))
|
|
if nClc1 then
|
|
-- se mantiene backset
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( nClc1, '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( nClc1, 'ProbeSide', '1')
|
|
end
|
|
EgtSetInfo( nClc1,'SideDoor',sSide)
|
|
if cl <= 1 or cl == 3 then
|
|
-- angolo x+y+
|
|
nClc2 = EgtCopyGlob( nClc1, Lg)
|
|
EgtRotate( nClc2, Point3d(0,0,0), Z_AX(), -90)
|
|
EgtMove( nClc2, Point3d( EgtIf( mc, L, (L/2)),(H/2),0) - ORIG())
|
|
-- angolo x+y-
|
|
nClc3 = EgtCopyGlob( nClc1, Lg)
|
|
EgtRotate( nClc3, Point3d(0,0,0), Z_AX(), 180)
|
|
EgtMove( nClc3, Point3d(EgtIf( mc, L, (L/2)),-(H/2),0) - ORIG())
|
|
if cl == 1 or mc then
|
|
EgtErase(nClc1)
|
|
end
|
|
end
|
|
if not mc and ( cl == 0 or cl >= 2) then
|
|
-- angolo x-y-
|
|
nClc4 = EgtCopyGlob( nClc1, Lg)
|
|
EgtRotate( nClc4, Point3d(0,0,0), Z_AX(), 90)
|
|
EgtMove( nClc4, Point3d(-(L/2),-(H/2),0) - ORIG())
|
|
-- angolo x-y+
|
|
EgtMove( nClc1, Point3d(-(L/2),(H/2),0) - ORIG())
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
if bMakeMortGeom then -- se mortise su fianco abilitata
|
|
|
|
if mh then -- se devo fare il foro
|
|
|
|
hint_2 = EgtCircle( Lg, Point3d(0,0,0), H2/2 , GDB_RT.LOC)
|
|
EgtModifyCurveThickness(hint_2, -T2)
|
|
EgtSetName(hint_2,LGH)
|
|
-- se mantiene centro spessore su mortise
|
|
if kbs and kbs > 1 then
|
|
EgtSetInfo( hint_2, '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_2, 'ProbeSide', '1')
|
|
end
|
|
else
|
|
-- assegno i valori coerenti con la tabella del componente
|
|
dFirstMortise.T = T
|
|
dFirstMortise.L2 = L2
|
|
dFirstMortise.H2 = H2
|
|
dFirstMortise.T2 = T2
|
|
dFirstMortise.s = s
|
|
dFirstMortise.d = d
|
|
dFirstMortise.p = p
|
|
dFirstMortise.jn = jn
|
|
dFirstMortise.d3 = d2
|
|
dFirstMortise.p3 = p2
|
|
dFirstMortise.invG = invG
|
|
dFirstMortise.mkrev = false -- disabilito la creazione del percorso in senso contrario
|
|
dFirstMortise.L3 = L2
|
|
dFirstMortise.H3 = H2
|
|
dFirstMortise.LGM = LG2
|
|
dFirstMortise.LMM = LA
|
|
dFirstMortise.Nome = sCompoName
|
|
dFirstMortise.jne = false
|
|
dFirstMortise.D_X = D_X
|
|
|
|
-- lancio il secondo componente base
|
|
if mc then -- se tipo corner
|
|
MHgen = require('_MortiseCorner')
|
|
else
|
|
MHgen = require('_Mortise')
|
|
end
|
|
hint_2, hintPk2 = MHgen.Draw( EC, EM, dFirstMortise, bPreview, bRunByCompo, nDrawMach, Pz, Lg, 0)
|
|
end
|
|
|
|
-- setto le note che indicareno su che lato della porta devono essere messe le geometrie
|
|
if hint_2 then EgtSetInfo( hint_2, 'SideDoor', 'Lock') end
|
|
if hintPk2 then EgtSetInfo( hintPk2, 'SideDoor', 'Lock') end
|
|
end
|
|
|
|
if bMakeBoreGeom then -- se foro di testa abilitato
|
|
|
|
hint_3 = EgtCircle( Lg, Point3d(0,0,0), H3/2 , GDB_RT.LOC)
|
|
if hint_3 then
|
|
EgtModifyCurveThickness( hint_3, -T3)
|
|
EgtSetName( hint_3, LG3)
|
|
EgtSetInfo( hint_3, 'SideDoor', 'Lock')
|
|
EgtSetInfo( hint_3, 'HeadSide', 'head')
|
|
-- se mantiene centro spessore su mortise
|
|
if kbs and kbs > 1 then
|
|
EgtSetInfo( hint_3, '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_3, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
|
|
if bMake2ndFaceGeom then -- se cava di testa abilitata
|
|
|
|
-- in base agli arrotondamenti della seconda faccia, calcolo lo spostamento per posizionare la cava in centro
|
|
if cl4 == 1 then -- se arrotondamento a sinistra
|
|
nPos2nd = -(rf4/2)
|
|
elseif cl4 == 2 then -- se arrotondamento a destra
|
|
nPos2nd = rf4/2
|
|
else
|
|
nPos2nd = 0
|
|
end
|
|
|
|
local clTemp
|
|
|
|
-- riassegno il valore impostazione originario
|
|
nForceMakeFace = nDrawMach
|
|
|
|
-- prima cava face completa
|
|
-- assegno i valori coerenti con la tabella del componente
|
|
dSecondface.L = L4
|
|
dSecondface.H = H4
|
|
dSecondface.T = T4
|
|
dSecondface.d = d4
|
|
dSecondface.p = p4
|
|
dSecondface.rf = rf4
|
|
dSecondface.sf = sf4
|
|
dSecondface.jn = jn6
|
|
dSecondface.L2 = L6
|
|
dSecondface.H2 = H6
|
|
dSecondface.est = est
|
|
dSecondface.invG = invG
|
|
if ech4 then
|
|
dSecondface.LG = LG4 .. CH
|
|
-- se ho abilitato solo le geometrie di lavorazione, abilito la generazione di entrambe per il contorno chisel
|
|
if nDrawMach == 1 then
|
|
nForceMakeFace = 2
|
|
end
|
|
else
|
|
dSecondface.LG = LG4
|
|
end
|
|
dSecondface.LM = LM4
|
|
dSecondface.Nome = sCompoName
|
|
|
|
-- inverto la raggiatura e l'applicazione dei clean corner
|
|
-- perché poi viene fatta una rotazione di 180 gradi
|
|
if mc then -- se tipo corner
|
|
if cl4 == 1 then
|
|
dSecondface.cl = 2
|
|
clTemp = 2
|
|
elseif cl4 == 2 then
|
|
dSecondface.cl = 1
|
|
clTemp = 1
|
|
else
|
|
dSecondface.cl = cl4
|
|
clTemp = cl4
|
|
end
|
|
else -- altrimenti tipo extension
|
|
if cl4 == 1 then
|
|
dSecondface.cl = 2
|
|
clTemp = 2
|
|
elseif cl4 == 2 then
|
|
dSecondface.cl = 1
|
|
clTemp = 1
|
|
else
|
|
dSecondface.cl = cl4
|
|
clTemp = cl4
|
|
end
|
|
end
|
|
|
|
-- lancio il componente base per disegnare la face completa
|
|
if mc or bStrike2ndFaceGeom then -- se tipo corner o tipo extension ma sconfinante dal bordo
|
|
dSecondface.D_X = 0
|
|
dSecondface.d2 = d5
|
|
dSecondface.LA = LM5
|
|
MHgen = require( '_LatchCorner')
|
|
else
|
|
dSecondface.D_X = - nPos2nd + DM_X
|
|
dSecondface.d2 = nil -- resetto il parametro per antischeggia
|
|
dSecondface.LA = nil -- resetto la label per antischeggia
|
|
MHgen = require( '_Latch')
|
|
end
|
|
dSecondface.Dws = nil -- disabilito per non creare geometrie (doppie) inerenti il calcolo regioni nei componenti chiamati
|
|
hint_4, hintPk4, hintAs_4 = MHgen.Draw( EC, EM, dSecondface, bPreview, bRunByCompo, nForceMakeFace, Pz, Lg, dThickDoor)
|
|
|
|
-- setto le note che indicano su che lato della porta devono essere messe le geometrie
|
|
if hint_4 then
|
|
EgtSetInfo( hint_4, 'SideDoor', 'Lock')
|
|
EgtSetInfo( hint_4, 'HeadSide', 'head')
|
|
-- se mantiene centro spessore anche su face
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( hint_4, '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_4, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hintPk4 then
|
|
EgtSetInfo( hintPk4, 'SideDoor', 'Lock')
|
|
EgtSetInfo( hintPk4, 'HeadSide', 'head')
|
|
-- se mantiene centro spessore anche su face
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( hintPk4, '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( hintPk4, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hintAs_4 then
|
|
EgtSetInfo( hintAs_4, 'SideDoor', 'Lock')
|
|
EgtSetInfo( hintAs_4, 'HeadSide', 'head')
|
|
-- se mantiene centro spessore anche su face
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( hintAs_4, '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( hintAs_4, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
|
|
-- Clean corner on head
|
|
if nDrawMach >= 0 then -- se abilitata geometria
|
|
if clTemp ~= 3 or ( clTemp == 3 and rf4 > 0) then -- se c'è almeno un lato senza raccordo
|
|
if CLC4 and clc4 and clc4 > 0 and clc4 < H4 and clc4 < L4 then
|
|
|
|
nClc1h = MakeClcPath( clc4, ccr4, CLC4, Lg, -T4, (invG == -1))
|
|
if nClc1h then
|
|
-- se mantiene backset
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( nClc1h, '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( nClc1h, 'ProbeSide', '1')
|
|
end
|
|
EgtSetInfo( nClc1h, 'SideDoor', 'Lock')
|
|
EgtSetInfo( nClc1h, 'HeadSide', 'head')
|
|
if clTemp <= 1 or clTemp == 3 then
|
|
-- angolo x+y+
|
|
nClc2h = EgtCopyGlob( nClc1h, Lg)
|
|
EgtRotate( nClc2h, Point3d(0,0,0), Z_AX(), -90)
|
|
EgtMove( nClc2h, Point3d( EgtIf( mc or bStrike2ndFaceGeom, L4, (L4/2)-nPos2nd),(H4/2),0) - ORIG())
|
|
-- angolo x+y-
|
|
nClc3h = EgtCopyGlob( nClc1h, Lg)
|
|
EgtRotate( nClc3h, Point3d(0,0,0), Z_AX(), 180)
|
|
EgtMove( nClc3h, Point3d( EgtIf( mc or bStrike2ndFaceGeom, L4, (L4/2)-nPos2nd),-(H4/2),0) - ORIG())
|
|
if clTemp == 1 or mc or bStrike2ndFaceGeom then
|
|
EgtErase(nClc1h)
|
|
end
|
|
end
|
|
if not mc and not bStrike2ndFaceGeom and ( clTemp == 0 or clTemp >= 2) then
|
|
-- angolo x-y-
|
|
nClc4h = EgtCopyGlob( nClc1h, Lg)
|
|
EgtRotate( nClc4h, Point3d(0,0,0), Z_AX(), 90)
|
|
EgtMove( nClc4h, Point3d(-(L4/2)-nPos2nd,-(H4/2),0) - ORIG())
|
|
-- angolo x-y+
|
|
EgtMove( nClc1h, Point3d(-(L4/2)-nPos2nd,(H4/2),0) - ORIG())
|
|
elseif not mc and bStrike2ndFaceGeom then
|
|
EgtErase(nClc1h)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
if bMake2ndMortGeom then -- se mortise di testa abilitata
|
|
|
|
-- assegno i valori coerenti con la tabella del componente
|
|
dSecondMortise.T = T4
|
|
dSecondMortise.L2 = L6
|
|
dSecondMortise.H2 = H6
|
|
dSecondMortise.T2 = T6
|
|
dSecondMortise.s = s6
|
|
dSecondMortise.d = d4
|
|
dSecondMortise.p = p4
|
|
dSecondMortise.jn = jn6
|
|
dSecondMortise.d3 = d6
|
|
dSecondMortise.p3 = p6
|
|
dSecondMortise.invG = invG
|
|
dSecondMortise.mkrev = false -- disabilito la creazione del percorso in senso contrario
|
|
dSecondMortise.L3 = L6
|
|
dSecondMortise.H3 = H6
|
|
dSecondMortise.LGM = LG6
|
|
dSecondMortise.LMM = LM6
|
|
dSecondMortise.Nome = sCompoName
|
|
dSecondMortise.jne = false
|
|
dSecondMortise.D_X = DM_X
|
|
|
|
MHgen = require('_Mortise')
|
|
hint_6, hintPk6 = MHgen.Draw( EC, EM, dSecondMortise, bPreview, bRunByCompo, nDrawMach, Pz, Lg, 0)
|
|
|
|
-- setto le note che indicareno su che lato della porta devono essere messe le geometrie
|
|
if hint_6 then
|
|
EgtSetInfo(hint_6,'SideDoor','Lock')
|
|
EgtSetInfo(hint_6,'HeadSide','head')
|
|
end
|
|
if hintPk6 then
|
|
EgtSetInfo(hintPk6,'SideDoor','Lock')
|
|
EgtSetInfo(hintPk6,'HeadSide','head')
|
|
end
|
|
end
|
|
|
|
if EC == 0 and not mc and (hint or hintPk) and abs(nPos1st) > GEO.EPS_SMALL then -- se esiste la prima face
|
|
if hint then
|
|
EgtMove( hint, Point3d(nPos1st,0,0) - ORIG())
|
|
end
|
|
if hintPk then
|
|
EgtMove( hintPk, Point3d(nPos1st,0,0) - ORIG())
|
|
end
|
|
end
|
|
|
|
if EC == 0 and mh and hint_2 and abs(D_X) > GEO.EPS_SMALL then -- se esiste il secondo foro
|
|
EgtMove( hint_2, Point3d(D_X,0,0) - ORIG())
|
|
end
|
|
|
|
if EC == 0 and not mh and (hint_2 or hintPk2) and abs(D_X) > GEO.EPS_SMALL then -- se esiste la seconda cava
|
|
if hint_2 then
|
|
EgtMove( hint_2, Point3d(D_X,0,0) - ORIG())
|
|
end
|
|
if hintPk2 then
|
|
EgtMove( hintPk2, Point3d(D_X,0,0) - ORIG())
|
|
end
|
|
end
|
|
|
|
if jn and EC == 0 and hintPk and hintPk2 then
|
|
-- recupero la nota delle variazioni dalla geometria del face
|
|
local sVarNote = EgtGetInfo( hintPk, 'MVar')
|
|
nPkJoin = EgtCurveCompo( Lg, {hintPk,hintPk2}, true)
|
|
if nPkJoin then
|
|
EgtSetName( nPkJoin, LM)
|
|
EgtSetInfo( nPkJoin, 'NotCheckDir', '1')
|
|
if sVarNote then EgtSetInfo( nPkJoin, 'MVar', sVarNote) end
|
|
-- se concatenata con la seconda cava (mortasa), forzo la posizione a Lock ( non segue angolo del profilo bevel)
|
|
EgtSetInfo(nPkJoin,'SideDoor','Lock')
|
|
-- se mantiene centro spessore anche su face
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( nPkJoin, 'KeepBackSet', 'c') -- setto 'c' perché viene mantenuto il centro spessore
|
|
EgtSetInfo( hint_2, '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( nPkJoin, 'ProbeSide', '1')
|
|
EgtSetInfo( hint_2, 'ProbeSide', '1')
|
|
end
|
|
else
|
|
EC = ErrorBase + 50
|
|
EM = string.format(EgtDoorsMsg[426], sCompoPath)
|
|
end
|
|
elseif not jn and EC == 0 and hintPk2 then
|
|
-- se mantiene centro spessore su mortise
|
|
if kbs and kbs > 1 then
|
|
EgtSetInfo( hintPk2, 'KeepBackSet', 'c') -- setto 'c' perché viene mantenuto il centro spessore
|
|
EgtSetInfo( hint_2, '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( hintPk2, 'ProbeSide', '1')
|
|
EgtSetInfo( hint_2, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
|
|
if EC == 0 then
|
|
|
|
-- Costruzione della geometria side
|
|
-- Extra side bores
|
|
for k = 1, 10 do
|
|
|
|
local D10 = tExtraSHBore[k][1]
|
|
local T10 = tExtraSHBore[k][2]
|
|
local I10 = tExtraSHBore[k][3]
|
|
local PX10 = tExtraSHBore[k][4]
|
|
local PY10 = tExtraSHBore[k][5]
|
|
local EB10 = tExtraSHBore[k][6]
|
|
local HB10 = tExtraSHBore[k][7]
|
|
|
|
if dws and T10 and abs(T10) > ttp then
|
|
T10 = ttp
|
|
end
|
|
|
|
-- se dimensioni foro sono 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 I10 then I10 = 0 end
|
|
if not PX10 then PX10 = 0 end
|
|
if not PY10 then PY10 = 0 end
|
|
|
|
local dInt10 = (I10/2)
|
|
local dPosX10 = PX10
|
|
local nBI = 0
|
|
-- creo foro o asola con eventuale svuotatura a rampa
|
|
nBI = MakeBore( Lg, EB10, dPosX10, dInt10, D10, PY10, T10, kbs, HB10, dws, nBI, D_XE, nil, nil, pbs)
|
|
-- se l'interasse è valido
|
|
if abs(I10) > GEO.EPS_SMALL then
|
|
-- creo foro o asola con eventuale svuotatura a rampa
|
|
nBI = MakeBore( Lg, EB10, dPosX10, -dInt10, D10, PY10, T10, kbs, HB10, dws, nBI, D_XE, nil, nil, pbs)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- se tipo extension muovo le geometrie del delta impostato
|
|
if not mc then
|
|
|
|
if D_XE and D_XE ~= 0 then
|
|
|
|
if nPkJoin then
|
|
EgtMove( nPkJoin, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if hint_2 then
|
|
EgtMove( hint_2, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if hintPk2 then
|
|
EgtMove( hintPk2, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if hintPk then
|
|
EgtMove( hintPk, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if hint then
|
|
EgtMove( hint, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if hintAs then
|
|
EgtMove( hintAs, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if nClc1 then
|
|
EgtMove( nClc1, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if nClc2 then
|
|
EgtMove( nClc2, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if nClc3 then
|
|
EgtMove( nClc3, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
if nClc4 then
|
|
EgtMove( nClc4, Point3d(D_XE,0,0) - ORIG())
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
if EC == 0 then
|
|
|
|
local dValX = (DB_X+DF_X+nPos2nd)
|
|
local dShiftZed = DGD.POSITION
|
|
|
|
if bStrike2ndFaceGeom then dValX = 0 end
|
|
|
|
-- Costruzione Extra head bores
|
|
for k = 11, 15 do
|
|
|
|
local D10 = tExtraSHBore[k][1]
|
|
local T10 = tExtraSHBore[k][2]
|
|
local I10 = tExtraSHBore[k][3]
|
|
local PX10 = tExtraSHBore[k][4]
|
|
local PY10 = tExtraSHBore[k][5]
|
|
local EB10 = tExtraSHBore[k][6]
|
|
|
|
if dws and T10 and abs(T10) > ttp then
|
|
T10 = ttp
|
|
end
|
|
|
|
-- se dimensioni foro sono 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 I10 then I10 = 0 end
|
|
if not PX10 then PX10 = 0 end
|
|
if not PY10 then PY10 = 0 end
|
|
-- azzero il parametro position e dValX
|
|
if mc then
|
|
dShiftZed = 0
|
|
dValX=0
|
|
end
|
|
|
|
local dInt10 = (I10/2)
|
|
local dPosX10 = PX10
|
|
local nBI = 0
|
|
-- creo foro o asola con eventuale svuotatura a rampa
|
|
nBI = MakeBore( Lg, EB10, dPosX10, dInt10, D10, -PY10, T10, kbs, false, false, nBI, dValX, true, dShiftZed, pbs)
|
|
-- se l'interasse è valido
|
|
if abs(I10) > GEO.EPS_SMALL then
|
|
-- creo foro o asola con eventuale svuotatura a rampa
|
|
nBI = MakeBore( Lg, EB10, dPosX10, -dInt10, D10, -PY10, T10, kbs, false, false, nBI, dValX, true, dShiftZed, pbs)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- se tipo extension le sposto e la ruoto
|
|
if not mc then
|
|
if hint_4 then
|
|
EgtMove( hint_4, Point3d(dValX,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( hint_4, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hint_4, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hintPk4 then
|
|
EgtMove( hintPk4, Point3d(dValX,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( hintPk4, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hintPk4, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hintAs_4 then
|
|
EgtMove( hintAs_4, Point3d(dValX,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( hintAs_4, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hintAs_4, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hint_6 then
|
|
EgtMove( hint_6, Point3d(dValX+DM_X,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( hint_6, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hint_6, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hintPk6 then
|
|
EgtMove( hintPk6, Point3d(dValX+DM_X,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( hintPk6, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hintPk6, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc1h then
|
|
EgtMove( nClc1h, Point3d(dValX,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( nClc1h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc1h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc2h then
|
|
EgtMove( nClc2h, Point3d(dValX,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( nClc2h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc2h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc3h then
|
|
EgtMove( nClc3h, Point3d(dValX,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( nClc3h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc3h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc4h then
|
|
EgtMove( nClc4h, Point3d(dValX,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( nClc4h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc4h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
end
|
|
end
|
|
|
|
-- se tipo extension ed esiste il foro di testa lo sposto e lo ruoto
|
|
if EC == 0 and not mc and hint_3 then
|
|
EgtMove( hint_3, Point3d(DB_X,0,DGD.POSITION) - ORIG())
|
|
EgtRotate( hint_3, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hint_3, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
|
|
-- se tipo corner ed esiste almeno una geometria le sposto e la ruoto
|
|
if EC == 0 and mc then
|
|
if hint_4 then
|
|
EgtRotate( hint_4, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hint_4, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hintPk4 then
|
|
EgtRotate( hintPk4, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hintPk4, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hintAs_4 then
|
|
EgtRotate( hintAs_4, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hintAs_4, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hint_6 then
|
|
EgtRotate( hint_6, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hint_6, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if hintPk6 then
|
|
EgtRotate( hintPk6, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( hintPk6, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc1h then
|
|
EgtRotate( nClc1h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc1h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc2h then
|
|
EgtRotate( nClc2h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc2h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc3h then
|
|
EgtRotate( nClc3h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc3h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
if nClc4h then
|
|
EgtRotate( nClc4h, ORIG(), Z_AX(), 180 ) -- ribalto in Z
|
|
EgtRotate( nClc4h, ORIG(), Y_AX(), -90 ) -- ruoto in Y per posizionarlo in testa ( con swing RH/RHR)
|
|
end
|
|
end
|
|
|
|
if jn6 and EC == 0 and hintPk4 and hintPk6 then
|
|
-- recupero la nota delle variazioni dalla geometria del face
|
|
local sVarNote = EgtGetInfo( hintPk4, 'MVar')
|
|
nPkJoin = EgtCurveCompo( Lg, {hintPk4,hintPk6}, true)
|
|
if nPkJoin then
|
|
EgtSetName( nPkJoin, LM6)
|
|
EgtSetInfo( nPkJoin, 'NotCheckDir', '1')
|
|
if sVarNote then EgtSetInfo( nPkJoin, 'MVar', sVarNote) end
|
|
-- se concatenata con la seconda cava (mortasa), forzo la posizione a Lock ( non segue angolo del profilo bevel)
|
|
EgtSetInfo( nPkJoin, 'SideDoor', 'Lock')
|
|
EgtSetInfo( nPkJoin, 'HeadSide', 'head')
|
|
-- se mantiene centro spessore anche su face
|
|
if kbs and kbs > 0 then
|
|
EgtSetInfo( nPkJoin, 'KeepBackSet', 'c') -- setto 'c' perché viene mantenuto il centro spessore
|
|
EgtSetInfo( hint_6, '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( nPkJoin, 'ProbeSide', '1')
|
|
EgtSetInfo( hint_6, 'ProbeSide', '1')
|
|
end
|
|
else
|
|
EC = ErrorBase + 51
|
|
EM = string.format(EgtDoorsMsg[426], sCompoPath)
|
|
end
|
|
elseif not jn6 and EC == 0 and hintPk6 then
|
|
-- se mantiene centro spessore su mortise
|
|
if kbs and kbs > 1 then
|
|
EgtSetInfo( hintPk6, 'KeepBackSet', 'c') -- setto 'c' perché viene mantenuto il centro spessore
|
|
EgtSetInfo( hint_6, '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( hintPk6, 'ProbeSide', '1')
|
|
EgtSetInfo( hint_6, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
|
|
if EC == 0 and nDrawMach > 0 and posh and L then
|
|
|
|
local dPosProbe = 0
|
|
local sPositiveSuffixProbe = ''
|
|
local sNegativeSuffixProbe = ''
|
|
|
|
if posp and posp > 0 then
|
|
if mc then
|
|
dPosProbe = L + posp
|
|
else
|
|
dPosProbe = (L/2) + posp
|
|
if SD == 'top' then
|
|
if ( SL == 'R' and DGD.Push) or ( SL == 'L' and not DGD.Push) then
|
|
sPositiveSuffixProbe = '_NEG'
|
|
sNegativeSuffixProbe = '_POS'
|
|
else
|
|
sPositiveSuffixProbe = '_POS'
|
|
sNegativeSuffixProbe = '_NEG'
|
|
end
|
|
else
|
|
if ( SL == 'R' and DGD.Push) or ( SL == 'L' and not DGD.Push) then
|
|
sPositiveSuffixProbe = '_POS'
|
|
sNegativeSuffixProbe = '_NEG'
|
|
else
|
|
sPositiveSuffixProbe = '_NEG'
|
|
sNegativeSuffixProbe = '_POS'
|
|
end
|
|
end
|
|
end
|
|
elseif mc then
|
|
dPosProbe = (L/2)
|
|
end
|
|
|
|
local pCentr = Point3d( dPosProbe, posh, 0)
|
|
local hintPr = EgtArc( Lg, pCentr, 1, 0, -360, 0, GDB_RT.LOC)
|
|
|
|
-- verifico se devo forzare direzione orizzontale o seguire il profilo
|
|
local sSideDoorInfo
|
|
if DGC.Fpd then
|
|
sSideDoorInfo = 'Lock'
|
|
else
|
|
sSideDoorInfo = EgtIf( dl, 'Lock', 'Side')
|
|
end
|
|
|
|
if hintPr then
|
|
EgtModifyCurveThickness( hintPr, -10)
|
|
EgtSetName( hintPr, LH..sPositiveSuffixProbe)
|
|
EgtSetInfo( hintPr, 'SideDoor', sSideDoorInfo)
|
|
end
|
|
if dPosProbe > 0 and not mc then
|
|
pCentr = Point3d( -dPosProbe, posh, 0)
|
|
hintPr = EgtArc( Lg, pCentr, 1, 0, -360, 0, GDB_RT.LOC)
|
|
if hintPr then
|
|
EgtModifyCurveThickness( hintPr, -10)
|
|
EgtSetName( hintPr, LH..sNegativeSuffixProbe)
|
|
EgtSetInfo( hintPr, 'SideDoor', sSideDoorInfo)
|
|
end
|
|
end
|
|
end
|
|
|
|
-- inserisco geometria extra Keyway
|
|
if EC == 0 then -- se nessun errore
|
|
|
|
-- Costruzione della geometria KEYWAY
|
|
-- Extra bores Keyway
|
|
for k = 1, 10 do
|
|
|
|
local D10 = tExtraBore[k][1]
|
|
local T10 = tExtraBore[k][2]
|
|
local PX10 = tExtraBore[k][3] or 0
|
|
local PY10 = tExtraBore[k][4] or 0
|
|
local EB10 = tExtraBore[k][5]
|
|
local RBS10 = tExtraBore[k][6]
|
|
|
|
-- se dimensioni foro 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
|
|
|
|
hint_13 = EgtCircle( Lg, Point3d(PX10,PY10,0), D10/2, GDB_RT.LOC)
|
|
EgtModifyCurveThickness( hint_13, -T10)
|
|
EgtSetName( hint_13, EB10)
|
|
EgtSetInfo( hint_13, 'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_13, 'ReferHw',RBS10) -- setto la nota che indicaa cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_13, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
--debug
|
|
-- EgtSaveFile()
|
|
-- EgtMove(DGD.PZ, Point3d(0,0,nil) - ORIG())
|
|
|
|
-- Extra rectangles Keyway
|
|
for k = 1, 5 do
|
|
|
|
local LR10 = tExtraRect[k][1]
|
|
local WR10 = tExtraRect[k][2]
|
|
local RR10 = tExtraRect[k][3]
|
|
local TR10 = tExtraRect[k][4]
|
|
local PRX10 = tExtraRect[k][5] or 0
|
|
local PRY10 = tExtraRect[k][6] or 0
|
|
local AR10 = tExtraRect[k][7]
|
|
local ER10 = tExtraRect[k][8]
|
|
local RRS10 = tExtraRect[k][9]
|
|
|
|
-- se parametri esistenti e dimensioni rettangolo idonee
|
|
if LR10 and WR10 and TR10 and ER10 then
|
|
if LR10 > 0 and WR10 > 0 and TR10 ~= 0 and ER10 ~= '' and
|
|
(2*RR10) < LR10 and (2*RR10) < WR10 then
|
|
|
|
if not Lg then
|
|
Lg = EgtGroup(Pz,GDB_RT.LOC)
|
|
EgtSetName(Lg,sCompoName)
|
|
end
|
|
if AR10 and abs(AR10) >= 360 then
|
|
while abs(AR10) >= 360 do
|
|
AR10 = AR10 + EgtIf( AR10 > 0, -360, 360)
|
|
end
|
|
end
|
|
|
|
hint_13 = MakeRectWithFillet( Lg, Point3d((PRX10-(LR10/2)),(PRY10-(WR10/2)),0), Point3d((PRX10+(LR10/2)),(PRY10+(WR10/2)),0), RR10, AR10)
|
|
EgtModifyCurveThickness( hint_13, -TR10)
|
|
EgtSetName( hint_13,ER10)
|
|
EgtSetInfo( hint_13,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_13,'ReferHw',RRS10) -- setto la nota che indicaa cosa è riferita, false: per backset true: per door side
|
|
-- se rettangolo sborda faccio antischeggia
|
|
if nDrawMach > 0 and EAR and (( das and das > 0) or ( das2 and das2 > 0)) then
|
|
-- creo percorso anti-scheggia se rettangolo sborda
|
|
hint_14, hint_15, hint_10, hint_11 = MakeAspOnStrikeRect( Lg, hint_13, LR10, WR10, TR10,
|
|
DGD.dT, PRX10, PRY10, RRS10, nil,
|
|
das, nil, nil, das2, SL,
|
|
'keyway')
|
|
|
|
if hint_14 then
|
|
EgtSetName( hint_14, ASG)
|
|
EgtSetInfo( hint_14, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_14, 'SideDoor', 'Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_14, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_14, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hint_15 then
|
|
EgtSetName( hint_15, ASG)
|
|
EgtSetInfo( hint_15, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_15, 'SideDoor', 'Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_15, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_15, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hint_10 then
|
|
EgtSetName( hint_10, ASGR)
|
|
EgtSetInfo( hint_10, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_10, 'SideDoor', 'Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_10, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_10, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hint_11 then
|
|
EgtSetName( hint_11, ASGR)
|
|
EgtSetInfo( hint_11, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_11, 'SideDoor', 'Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_11, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_11, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
-- setto nota per correzione profondità con probe
|
|
-- se mantiene profondità e non è a spessore passante
|
|
if kbs and kbs > 1 and TR10 < DGD.dT then
|
|
EgtSetInfo( hint_13, 'KeepBackSet', 'x') -- setto 'x' perché non si sa ancora da quale parte viene applicato
|
|
end
|
|
if pbs and pbs > 1 and TR10 < DGD.dT and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_13, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Extra lines Keyway
|
|
for k = 1, 5 do
|
|
|
|
local LL10 = tExtraLine[k][1]
|
|
local TL10 = tExtraLine[k][2]
|
|
local PLX10 = tExtraLine[k][3] or 0
|
|
local PLY10 = tExtraLine[k][4] or 0
|
|
local AL10 = tExtraLine[k][5]
|
|
local EL10 = tExtraLine[k][6]
|
|
local RLS10 = tExtraLine[k][7]
|
|
|
|
-- se parametri esistenti e dimensioni linea idonee
|
|
if LL10 and TL10 and EL10 then
|
|
if LL10 > 0 and TL10 ~= 0 and EL10 ~= '' and
|
|
AL10 < 360 and AL10 > -360 then
|
|
|
|
if not Lg then
|
|
Lg = EgtGroup(Pz,GDB_RT.LOC)
|
|
EgtSetName(Lg,sCompoName)
|
|
end
|
|
if AL10 and abs(AL10) >= 360 then
|
|
while abs(AL10) >= 360 do
|
|
AL10 = AL10 + EgtIf( AL10 > 0, -360, 360)
|
|
end
|
|
end
|
|
|
|
hint_13 = EgtLinePDL( Lg, Point3d( PLX10,PLY10,0), AL10, LL10, GDB_RT.LOC)
|
|
EgtModifyCurveThickness( hint_13, -TL10)
|
|
EgtSetName( hint_13,EL10)
|
|
EgtSetInfo( hint_13,'SideDoor','Keyway') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_13,'ReferHw',RLS10) -- setto la nota che indicaa cosa è riferita, false: per backset true: per door side
|
|
-- setto nota per correzione profondità con probe
|
|
-- se mantiene profondità e non è a spessore passante
|
|
if kbs and kbs > 1 and TL10 < DGD.dT then
|
|
EgtSetInfo( hint_13, 'KeepBackSet', 'x') -- setto 'x' perché non si sa ancora da quale parte viene applicato
|
|
end
|
|
if pbs and pbs > 1 and TL10 < DGD.dT and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_13, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Costruzione della geometria SECURE
|
|
-- Extra bores Secure
|
|
for k = 11, 20 do
|
|
|
|
local D10 = tExtraBore[k][1]
|
|
local T10 = tExtraBore[k][2]
|
|
local PX10 = tExtraBore[k][3] or 0
|
|
local PY10 = tExtraBore[k][4] or 0
|
|
local EB10 = tExtraBore[k][5]
|
|
local RBS10 = tExtraBore[k][6]
|
|
|
|
-- 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
|
|
|
|
hint_13 = EgtCircle( Lg, Point3d(PX10,-PY10,0), D10/2 , GDB_RT.LOC)
|
|
EgtModifyCurveThickness( hint_13, -T10)
|
|
EgtSetName( hint_13,EB10)
|
|
EgtSetInfo( hint_13,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_13,'ReferHw',RBS10) -- setto la nota che indicaa cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_13, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Extra rectangles Secure
|
|
for k = 6, 10 do
|
|
|
|
local LR10 = tExtraRect[k][1]
|
|
local WR10 = tExtraRect[k][2]
|
|
local RR10 = tExtraRect[k][3]
|
|
local TR10 = tExtraRect[k][4]
|
|
local PRX10 = tExtraRect[k][5] or 0
|
|
local PRY10 = tExtraRect[k][6] or 0
|
|
local AR10 = tExtraRect[k][7]
|
|
local ER10 = tExtraRect[k][8]
|
|
local RRS10 = tExtraRect[k][9]
|
|
|
|
-- se dimensioni rettangolo idonee
|
|
if LR10 and WR10 and TR10 and ER10 then
|
|
if LR10 > 0 and WR10 > 0 and TR10 ~= 0 and ER10 ~= '' and
|
|
(2*RR10) < LR10 and (2*RR10) < WR10 then
|
|
|
|
if not Lg then
|
|
Lg = EgtGroup(Pz,GDB_RT.LOC)
|
|
EgtSetName(Lg,sCompoName)
|
|
end
|
|
if AR10 and abs(AR10) >= 360 then
|
|
while abs(AR10) >= 360 do
|
|
AR10 = AR10 + EgtIf( AR10 > 0, -360, 360)
|
|
end
|
|
end
|
|
|
|
hint_13 = MakeRectWithFillet( Lg, Point3d((PRX10-(LR10/2)),(-PRY10-(WR10/2)),0), Point3d((PRX10+(LR10/2)),(-PRY10+(WR10/2)),0), RR10, AR10)
|
|
EgtModifyCurveThickness( hint_13, -TR10)
|
|
EgtSetName( hint_13, ER10)
|
|
EgtSetInfo( hint_13, 'SideDoor', 'Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_13, 'ReferHw', RRS10) -- setto la nota che indicaa cosa è riferita, false: per backset true: per door side
|
|
-- se rettangolo sborda faccio antischeggia
|
|
if nDrawMach > 0 and EAR and (( das and das > 0) or ( das2 and das2 > 0)) then
|
|
-- creo percorso anti-scheggia se rettangolo sborda
|
|
hint_14, hint_15, hint_10, hint_11 = MakeAspOnStrikeRect( Lg, hint_13, LR10, WR10, TR10,
|
|
DGD.dT, PRX10, PRY10, RRS10, nil,
|
|
das, true, nil, das2, SL,
|
|
'secure')
|
|
if hint_14 then
|
|
EgtSetName( hint_14, ASG)
|
|
EgtSetInfo( hint_14, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_14, 'SideDoor', 'Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_14, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_14, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hint_15 then
|
|
EgtSetName( hint_15, ASG)
|
|
EgtSetInfo( hint_15, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_15, 'SideDoor', 'Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_15, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_15, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hint_10 then
|
|
EgtSetName( hint_10, ASGR)
|
|
EgtSetInfo( hint_10, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_10, 'SideDoor', 'Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_10, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_10, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
if hint_11 then
|
|
EgtSetName( hint_11, ASGR)
|
|
EgtSetInfo( hint_11, 'NotCheckDir', '1')
|
|
EgtSetInfo( hint_11, 'SideDoor', 'Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_11, 'ReferHw', RRS10) -- setto la nota che indica a cosa è riferita, false: per backset true: per door side
|
|
if pbs and pbs > 1 and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_11, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
-- setto nota per correzione profondità con probe
|
|
-- se mantiene profondità e non è a spessore passante
|
|
if kbs and kbs > 1 and TR10 < DGD.dT then
|
|
EgtSetInfo( hint_13, 'KeepBackSet', 'x') -- setto 'x' perché non si sa ancora da quale parte viene applicato
|
|
end
|
|
if pbs and pbs > 1 and TR10 < DGD.dT and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_13, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Extra lines Secure
|
|
for k = 6, 10 do
|
|
|
|
local LL10 = tExtraLine[k][1]
|
|
local TL10 = tExtraLine[k][2]
|
|
local PLX10 = tExtraLine[k][3] or 0
|
|
local PLY10 = tExtraLine[k][4] or 0
|
|
local AL10 = tExtraLine[k][5]
|
|
local EL10 = tExtraLine[k][6]
|
|
local RLS10 = tExtraLine[k][7]
|
|
|
|
-- se parametri esistenti e dimensioni linea idonee
|
|
if LL10 and TL10 and EL10 then
|
|
if LL10 > 0 and TL10 ~= 0 and EL10 ~= '' and
|
|
AL10 < 360 and AL10 > -360 then
|
|
|
|
if not Lg then
|
|
Lg = EgtGroup(Pz,GDB_RT.LOC)
|
|
EgtSetName(Lg,sCompoName)
|
|
end
|
|
if AL10 and abs(AL10) >= 360 then
|
|
while abs(AL10) >= 360 do
|
|
AL10 = AL10 + EgtIf( AL10 > 0, -360, 360)
|
|
end
|
|
end
|
|
|
|
hint_13 = EgtLinePDL( Lg, Point3d( PLX10,-PLY10,0), AL10, LL10, GDB_RT.LOC)
|
|
EgtModifyCurveThickness( hint_13, -TL10)
|
|
EgtSetName( hint_13,EL10)
|
|
EgtSetInfo( hint_13,'SideDoor','Secure') -- setto una nota per indicare su che lato della porta deve essere spostato
|
|
EgtSetInfo( hint_13,'ReferHw',RLS10) -- setto la nota che indicaa cosa è riferita, false: per backset true: per door side
|
|
-- setto nota per correzione profondità con probe
|
|
-- se mantiene profondità e non è a spessore passante
|
|
if kbs and kbs > 1 and TL10 < DGD.dT then
|
|
EgtSetInfo( hint_13, 'KeepBackSet', 'x') -- setto 'x' perché non si sa ancora da quale parte viene applicato
|
|
end
|
|
if pbs and pbs > 1 and TL10 < DGD.dT and DGC.Pms and DGC.Pms > 2 then
|
|
EgtSetInfo( hint_13, 'ProbeSide', '1')
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
if EC == 0 and nDrawMach > 0 then -- se abilitata geometria lavorazione
|
|
|
|
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
|
|
if hint_2 then
|
|
nIdSideBoxUp = EgtCopyGlob( hint_2, Lg)
|
|
EgtSetName( nIdSideBoxUp, 'upper')
|
|
EgtSetInfo( nIdSideBoxUp, 'SideDoor', 'upper')
|
|
end
|
|
if hint_3 then
|
|
nIdSideBoxUp = EgtCopyGlob( hint_3, Lg)
|
|
EgtSetName( nIdSideBoxUp, 'upper')
|
|
EgtSetInfo( nIdSideBoxUp, 'SideDoor', 'upper')
|
|
end
|
|
if hint_4 then
|
|
nIdSideBoxUp = EgtCopyGlob( hint_4, Lg)
|
|
EgtSetName( nIdSideBoxUp, 'upper')
|
|
EgtSetInfo( nIdSideBoxUp, 'SideDoor', 'upper')
|
|
end
|
|
if hint_6 then
|
|
nIdSideBoxUp = EgtCopyGlob( hint_6, Lg)
|
|
EgtSetName( nIdSideBoxUp, 'upper')
|
|
EgtSetInfo( nIdSideBoxUp, 'SideDoor', 'upper')
|
|
end
|
|
end
|
|
end
|
|
--debug
|
|
-- EgtSaveFile()
|
|
-- EgtMove(DGD.PZ, Point3d(0,0,nil) - ORIG())
|
|
|
|
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 del flush bolt
|
|
EgtSetInfo( Lg, 'Type' ,'FlushBolt')
|
|
EgtSetInfo( Lg, 'Nome' ,sCompoName)
|
|
EgtSetInfo( Lg, 'L' ,L)
|
|
EgtSetInfo( Lg, 'H' ,H)
|
|
EgtSetInfo( Lg, 'T' ,T)
|
|
EgtSetInfo( Lg, 'd' ,d)
|
|
EgtSetInfo( Lg, 'p' ,p)
|
|
EgtSetInfo( Lg, 'cl' ,cl)
|
|
EgtSetInfo( Lg, 'rf' ,rf)
|
|
EgtSetInfo( Lg, 'sf' ,sf)
|
|
EgtSetInfo( Lg, 'dl' ,dl)
|
|
EgtSetInfo( Lg, 'clc' ,clc)
|
|
EgtSetInfo( Lg, 'ccr' ,ccr)
|
|
EgtSetInfo( Lg, 'mh' ,mh)
|
|
EgtSetInfo( Lg, 'L2' ,L2)
|
|
EgtSetInfo( Lg, 'H2' ,H2)
|
|
EgtSetInfo( Lg, 'T2' ,T2)
|
|
EgtSetInfo( Lg, 'd2' ,d2)
|
|
EgtSetInfo( Lg, 'p2' ,p2)
|
|
EgtSetInfo( Lg, 's' ,s)
|
|
EgtSetInfo( Lg, 'jn' ,jn)
|
|
EgtSetInfo( Lg, 'jnb' ,jnb)
|
|
EgtSetInfo( Lg, 'D_X' ,D_X)
|
|
EgtSetInfo( Lg, 'H3' ,H3)
|
|
EgtSetInfo( Lg, 'T3' ,T3)
|
|
EgtSetInfo( Lg, 'DB_X' ,DB_X)
|
|
EgtSetInfo( Lg, 'L4' ,L4)
|
|
EgtSetInfo( Lg, 'H4' ,H4)
|
|
EgtSetInfo( Lg, 'T4' ,T4)
|
|
EgtSetInfo( Lg, 'd4' ,d4)
|
|
EgtSetInfo( Lg, 'p4' ,p4)
|
|
EgtSetInfo( Lg, 'sf4' ,sf4)
|
|
EgtSetInfo( Lg, 'cl4' ,cl4)
|
|
EgtSetInfo( Lg, 'rf4' ,rf4)
|
|
EgtSetInfo( Lg, 'clc4' ,clc4)
|
|
EgtSetInfo( Lg, 'ccr4' ,ccr4)
|
|
EgtSetInfo( Lg, 'DF_X' ,DF_X)
|
|
EgtSetInfo( Lg, 'mc' ,mc)
|
|
EgtSetInfo( Lg, 'd5' ,d5)
|
|
EgtSetInfo( Lg, 'invG' ,invG)
|
|
EgtSetInfo( Lg, 'posh' ,posh)
|
|
EgtSetInfo( Lg, 'posp' ,posp)
|
|
EgtSetInfo( Lg, 'ech' ,ech)
|
|
EgtSetInfo( Lg, 'ech4' ,ech4)
|
|
EgtSetInfo( Lg, 'est' ,est)
|
|
EgtSetInfo( Lg, 'kbs' ,kbs)
|
|
EgtSetInfo( Lg, 'pbs' ,pbs)
|
|
EgtSetInfo( Lg, 'SL' ,SL)
|
|
EgtSetInfo( Lg, 'L6' ,L6)
|
|
EgtSetInfo( Lg, 'H6' ,H6)
|
|
EgtSetInfo( Lg, 'T6' ,T6)
|
|
EgtSetInfo( Lg, 'd6' ,d6)
|
|
EgtSetInfo( Lg, 'p6' ,p6)
|
|
EgtSetInfo( Lg, 's6' ,s6)
|
|
EgtSetInfo( Lg, 'jn6' ,jn6)
|
|
EgtSetInfo( Lg, 'DM_X' ,DM_X)
|
|
EgtSetInfo( Lg, 'D_XE' ,D_XE)
|
|
EgtSetInfo( Lg, 'dws' ,dws)
|
|
EgtSetInfo( Lg, 'dthd' ,dthd)
|
|
EgtSetInfo( Lg, 'ttp' ,ttp)
|
|
EgtSetInfo( Lg, 'LG' ,LG)
|
|
EgtSetInfo( Lg, 'LG2' ,LG2)
|
|
EgtSetInfo( Lg, 'LM' ,LM)
|
|
EgtSetInfo( Lg, 'LA' ,LA)
|
|
EgtSetInfo( Lg, 'LGH' ,LGH)
|
|
EgtSetInfo( Lg, 'LG3' ,LG3)
|
|
EgtSetInfo( Lg, 'LG4' ,LG4)
|
|
EgtSetInfo( Lg, 'LM4' ,LM4)
|
|
EgtSetInfo( Lg, 'LM5' ,LM5)
|
|
EgtSetInfo( Lg, 'LG6' ,LG6)
|
|
EgtSetInfo( Lg, 'LM6' ,LM6)
|
|
EgtSetInfo( Lg, 'CH' ,CH)
|
|
EgtSetInfo( Lg, 'CLC' ,CLC)
|
|
EgtSetInfo( Lg, 'CLC4' ,CLC4)
|
|
EgtSetInfo( Lg, 'EAR' ,EAR)
|
|
EgtSetInfo( Lg, 'das' ,das)
|
|
EgtSetInfo( Lg, 'ASG' ,ASG)
|
|
EgtSetInfo( Lg, 'das2' ,das2)
|
|
EgtSetInfo( Lg, 'ASGR' ,ASGR)
|
|
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 FlushBolt
|