- alzante scorrevole.
This commit is contained in:
+155
-18
@@ -39,8 +39,8 @@ local DebugCode = false
|
||||
local HoleWidth = 1835
|
||||
local HoleHeight = 1516
|
||||
|
||||
local WindowWidth = 900
|
||||
local WindowHeight = 1500
|
||||
local WindowWidth = 2500
|
||||
local WindowHeight = 2000
|
||||
|
||||
local WindowTree
|
||||
|
||||
@@ -67,26 +67,137 @@ local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.RECT, vFrameJoints, Windo
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.CHAMFER_SIDE, vFrameJoints, WindowWidth, WindowHeight, WindowHeight + 500)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.CHAMFER_SIDE, vFrameJoints, WindowWidth, WindowHeight + 500, WindowHeight)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.ROUND_ARC, vFrameJoints, WindowWidth, WindowHeight)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.SEGMENTAL_ARC, vFrameJoints, WindowWidth, WindowHeight, WindowHeight + 100)
|
||||
|
||||
-- vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType, SashJointType}
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.SEGMENTAL_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType}, 1500, 1800, 2200)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.CHAMFER, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, WindowWidth, WindowHeight, WindowHeight + 500)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.POINTED_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, 900, 1500, 2100)
|
||||
|
||||
-- vSashJoints = { SashJointType, SashJointType, SashJointType, SashJointType, SashJointType}
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.POINTED_ARC, { FrameJointType, FrameJointType, FrameJointType, FrameJointType, FrameJointType}, WindowWidth, WindowHeight, WindowHeight + 600)
|
||||
------------------------ Cambi profilo ------------------------
|
||||
-- vetro/anta
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddSash( vAreas[2], vSashJoints)
|
||||
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.TRG, {WIN_JNT.FULL_H, WIN_JNT.FULL_H, WIN_JNT.FULL_V}, WindowWidth, WindowHeight, WindowWidth)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.TRG, {WIN_JNT.FULL_V, WIN_JNT.FULL_V, WIN_JNT.FULL_V}, WindowWidth, WindowHeight, 0)
|
||||
-- local nFrameId = WinCreate.CreateFrame( WIN_FRAME_TYPE.TRG, {WIN_JNT.FULL_V, WIN_JNT.FULL_H, WIN_JNT.FULL_V}, WindowWidth, WindowHeight, WindowWidth - 100)
|
||||
-- vetro/anta orizzontale
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddSash( vAreas[2], vSashJoints)
|
||||
|
||||
-- anta/vetro
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddSash( vAreas[1], vSashJoints)
|
||||
|
||||
-- vetro/anta/vetro
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, 1)
|
||||
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddSash( vAreas[2], vSashJoints)
|
||||
-- WinCreate.AddFill( vAreas[3], WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- vetro/anta/anta
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.33, 0.33}, 1)
|
||||
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddSash( vAreas[2], vSashJoints)
|
||||
-- WinCreate.AddSash( vAreas[3], vSashJoints)
|
||||
|
||||
-- anta battente/anta ricevente/vetro
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.66}, 1)
|
||||
-- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH)
|
||||
-- WinCreate.AddSash( vAreas2[1], vSashJoints, WIN_SASHTYPES.ACTIVE)
|
||||
-- WinCreate.AddSash( vAreas2[2], vSashJoints, WIN_SASHTYPES.INACTIVE)
|
||||
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- vetro/anta/vetro/anta
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- local vAreas2 = WinCreate.AddSplits( vAreas[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- local vAreas3 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( vAreas3[1], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddSash( vAreas2[2], vSashJoints)
|
||||
-- WinCreate.AddSash( vAreas3[2], vSashJoints)
|
||||
|
||||
-- vetro/anta/vetro/anta
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25}, 1)
|
||||
-- WinCreate.AddFill( vAreas[1], WIN_FILLTYPES.GLASS)
|
||||
-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.75}, 1)
|
||||
-- WinCreate.AddSash( vAreas2[2], vSashJoints)
|
||||
-- local vAreas3 = WinCreate.AddSplits( vAreas2[1], WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- WinCreate.AddSash( vAreas3[1], vSashJoints)
|
||||
-- WinCreate.AddFill( vAreas3[2], WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- con split
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- WinCreate.AddSash( vAreas[1], vSashJoints)
|
||||
-- local vAreas2 = WinCreate.AddSplits( vAreas[2], WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- WinCreate.AddFill( vAreas2[1], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( vAreas2[2], WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- con split nell'anta
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
-- local nSash = WinCreate.AddSash( vAreas[1], vSashJoints)
|
||||
-- WinCreate.AddFill( vAreas[2], WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddSplits( nSash, WIN_SPLITORIENTATION.HORIZONTAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1)
|
||||
|
||||
|
||||
|
||||
------------------------ Alzante Scorrevole ------------------------
|
||||
|
||||
-- anta mobile a sx
|
||||
local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH)
|
||||
local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED)
|
||||
WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS)
|
||||
WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- anta mobile a dx
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED)
|
||||
-- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
-- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- 2 ante mobili, sx davanti
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
-- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK)
|
||||
-- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- 2 ante mobili, dx davanti
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.5}, 1, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK)
|
||||
-- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
-- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- 4 ante, le centrali sono mobili
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}, 1, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED)
|
||||
-- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
-- local nSash3 = WinCreate.AddSash( vAreas[3], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
-- local nSash4 = WinCreate.AddSash( vAreas[4], vSashJoints, WIN_SASHTYPES.SLIDE_FIXED)
|
||||
-- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash3, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash4, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-- 4 ante mobili
|
||||
-- local vAreas = WinCreate.AddSplits( nFrameId, WIN_SPLITORIENTATION.VERTICAL, WIN_MEASURE.PERCENTAGE, { 0.25, 0.25, 0.25}, 1, WIN_SPLITTYPES.FRENCH)
|
||||
-- local nSash1 = WinCreate.AddSash( vAreas[1], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK)
|
||||
-- local nSash2 = WinCreate.AddSash( vAreas[2], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
-- local nSash3 = WinCreate.AddSash( vAreas[3], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE)
|
||||
-- local nSash4 = WinCreate.AddSash( vAreas[4], vSashJoints, WIN_SASHTYPES.SLIDE_MOVABLE_BACK)
|
||||
-- WinCreate.AddFill( nSash1, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash2, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash3, WIN_FILLTYPES.GLASS)
|
||||
-- WinCreate.AddFill( nSash4, WIN_FILLTYPES.GLASS)
|
||||
|
||||
|
||||
------------------------ Finestra vetro fisso ------------------------
|
||||
|
||||
-- aggiungo zoccolo
|
||||
WinCreate.AddBottomRail( nFrameId)
|
||||
-- aggiungo vetro
|
||||
local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
|
||||
-- -- aggiungo zoccolo
|
||||
-- WinCreate.AddBottomRail( nFrameId)
|
||||
-- -- aggiungo vetro
|
||||
-- local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
------------------------ Finestra vetro fisso con divisione orizzontale ------------------------
|
||||
|
||||
@@ -569,20 +680,46 @@ local nFillId = WinCreate.AddFill( nFrameId, WIN_FILLTYPES.GLASS)
|
||||
|
||||
-----------------------------------------------------------------------------------
|
||||
|
||||
|
||||
-- aggiungo ferramenta
|
||||
WinCreate.AddHardware( nFrameId, '000545')
|
||||
-- WinCreate.AddHardware( nFrameId, '000545')
|
||||
|
||||
-- imposto se calcolare i solidi o meno
|
||||
WinCalculate.SetCalcSolid( true)
|
||||
|
||||
-- creo i pezzi
|
||||
WinCalculate.CreatePartFromArea( nFrameId)
|
||||
WinCalculate.AddHardware( nFrameId)
|
||||
|
||||
-- WinCalculate.AddHardware( nFrameId)
|
||||
|
||||
-- tronchetti
|
||||
-- local nLogsNbr = 4 -- 0 per numero minimo
|
||||
-- local vSections = { 100, 150, 80, 130, 120, 180}
|
||||
-- local bAlign = false
|
||||
-- local dOverMatOut = 10
|
||||
-- local dOverMatIn = 7
|
||||
-- local dOverMatExt = 5
|
||||
-- local dOverMatInt = 3
|
||||
-- local bCutExtremities = true
|
||||
-- -- cero i pezzi top ad arco
|
||||
-- local vTops = EgtGetNameInGroup( 0, WIN_TOP)
|
||||
-- for i = 1, #vTops do
|
||||
-- local nOutline = EgtGetInfo( vTops[i], WIN_REF_OUTLINE, 'i')
|
||||
-- if EgtGetType( nOutline) == GDB_TY.CRV_ARC then
|
||||
-- -- se anta richiedo allineamento con telaio
|
||||
-- local nAreaId = EgtGetParent( EgtGetParent( nOutline))
|
||||
-- local nAreaType = EgtGetInfo( nAreaId, WIN_AREATYPE, 'i')
|
||||
-- if nAreaType == WIN_AREATYPES.SASH then
|
||||
-- bAlign = true
|
||||
-- nLogsNbr = 0
|
||||
-- end
|
||||
-- WinCalculate.CreateArcLogs( vTops[i], nLogsNbr, vSections, bAlign, dOverMatOut, dOverMatIn, dOverMatExt, dOverMatInt, bCutExtremities)
|
||||
-- end
|
||||
-- end
|
||||
|
||||
|
||||
-- preparo per automatismo lavorazioni
|
||||
-- WinCalculate.PrepareProject()
|
||||
|
||||
|
||||
-- -- creo tabella per salvataggio
|
||||
-- local sSaveFilePath = 'c:\\Temp\\WindowTest1.txt'
|
||||
-- local WinTable = WinManageProject.WriteToFile( nFrameId, sSaveFilePath)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -105,6 +105,9 @@ WIN_SASHTYPES = {
|
||||
ACTIVE_OUT = 4,
|
||||
INACTIVE_IN = 5,
|
||||
INACTIVE_OUT = 6,
|
||||
SLIDE_MOVABLE = 7,
|
||||
SLIDE_FIXED = 8,
|
||||
SLIDE_MOVABLE_BACK = 9,
|
||||
}
|
||||
|
||||
WIN_CHILDREN_TYPES = {
|
||||
@@ -169,6 +172,20 @@ WIN_FRAME_SPLIT = 'Frame_Split'
|
||||
WIN_MIXED_BOTTOM = 'Mixed_Bottom'
|
||||
WIN_MIXED_TOP = 'Mixed_Top'
|
||||
WIN_MIXED_SPLIT = 'Mixed_Split'
|
||||
WIN_SLIDE_TOP = 'Slide_Top'
|
||||
WIN_SLIDE_BOTTOM = 'Slide_Bottom'
|
||||
WIN_SLIDE_MOVABLE = 'Slide_Movable'
|
||||
WIN_SLIDE_FIXED = 'Slide_Fixed'
|
||||
WIN_SLIDE_BOTTOM_MOVABLEBACK = 'Slide_Bottom_MovableBack'
|
||||
WIN_SLIDE_MOVABLE_TOP = 'Slide_Movable_Top'
|
||||
WIN_SLIDE_MOVABLE_BOTTOM = 'Slide_Movable_Bottom'
|
||||
WIN_SLIDE_MOVABLE_BACK_TOP = 'Slide_MovableBack_Top'
|
||||
WIN_SLIDE_MOVABLE_BACK_BOTTOM = 'Slide_MovableBack_Bottom'
|
||||
WIN_SLIDE_FIXED_BOTTOM = 'Slide_Fixed_Bottom'
|
||||
WIN_SLIDE_FIXED_TOP = 'Slide_Fixed_Top'
|
||||
WIN_SLIDE_ACTIVE = 'Slide_Active'
|
||||
WIN_SLIDE_ACTIVE_IN = 'Slide_Active_In'
|
||||
WIN_SLIDE_INACTIVE = 'Slide_Inactive'
|
||||
WIN_INFO_GRP = 'Info'
|
||||
|
||||
WIN_REF = 'Ref'
|
||||
|
||||
@@ -446,13 +446,58 @@ local function CalcProfileType( nAreaId)
|
||||
-- recupero il tipo dei figli
|
||||
local nChildrenType = GetChildrenType( nOutlineId)
|
||||
|
||||
if nChildrenType == WIN_CHILDREN_TYPES.NULL or nChildrenType == WIN_CHILDREN_TYPES.SASH then
|
||||
-- a) se non definiti gestisco come anta
|
||||
if nChildrenType == WIN_CHILDREN_TYPES.NULL then
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP)
|
||||
end
|
||||
|
||||
-- b) se anta
|
||||
elseif nChildrenType == WIN_CHILDREN_TYPES.SASH then
|
||||
-- verifico tipologia di anta contro cui poggia
|
||||
local vChildren = EgtGetInfo( nOutlineId, WIN_SASH_CHILDREN, 'vi')
|
||||
local nSashArea = EgtGetParent( EgtGetParent( vChildren[1]))
|
||||
local nSashType = EgtGetInfo( nSashArea, WIN_SASHTYPE, 'i') or WIN_SASHTYPES.NULL
|
||||
-- b1) alzante scorrevole
|
||||
if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE or nSashType == WIN_SASHTYPES.SLIDE_FIXED or nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_BOTTOM)
|
||||
-- se le ante contro cui poggia sono tutte mobili devo aggiornare il profilo
|
||||
if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_BOTTOM_MOVABLEBACK)
|
||||
elseif nSashType == WIN_SASHTYPES.SLIDE_MOVABLE then
|
||||
for i = 2, #vChildren do
|
||||
local nSashArea = EgtGetParent( EgtGetParent( vChildren[i]))
|
||||
local nSashType = EgtGetInfo( nSashArea, WIN_SASHTYPE, 'i') or WIN_SASHTYPES.NULL
|
||||
if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_BOTTOM_MOVABLEBACK)
|
||||
break
|
||||
elseif nSashType == WIN_SASHTYPES.SLIDE_FIXED then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif sName == WIN_TOP then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_TOP)
|
||||
else
|
||||
if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_MOVABLE)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_FIXED)
|
||||
end
|
||||
end
|
||||
-- b2) standard
|
||||
else
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_TOP)
|
||||
end
|
||||
end
|
||||
|
||||
-- c) se riempimento
|
||||
elseif nChildrenType == WIN_CHILDREN_TYPES.FILL then
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FIXED_BOTTOM)
|
||||
@@ -460,7 +505,8 @@ local function CalcProfileType( nAreaId)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FIXED_TOP)
|
||||
end
|
||||
|
||||
|
||||
-- d) se cambio profilo
|
||||
elseif nChildrenType == WIN_CHILDREN_TYPES.MIXED then
|
||||
EgtSetInfo( nOutlineId, WIN_PRF_CHANGE, true)
|
||||
if sName == WIN_BOTTOM then
|
||||
@@ -488,14 +534,24 @@ local function CalcProfileType( nAreaId)
|
||||
|
||||
-- SASH
|
||||
elseif nAreaType == WIN_AREATYPES.SASH then
|
||||
-- verifico se e' di tipo battente ricevente
|
||||
local nSashType = EgtGetInfo( nAreaId, WIN_SASHTYPE, 'i')
|
||||
if nSashType and nSashType ~= WIN_SASHTYPES.NULL then
|
||||
-- imposto profili sash
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
|
||||
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
while nOutlineId do
|
||||
-- verifico se deriva da una curva di split di tipo french ( e quindi deve avere profilo battente/ricevente)
|
||||
-- verifico tipologia di anta ( battente, ricevente, alzante scorrevole)
|
||||
local nSashType = EgtGetInfo( nAreaId, WIN_SASHTYPE, 'i') or WIN_SASHTYPES.NULL
|
||||
-- imposto profili sash
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
|
||||
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
while nOutlineId do
|
||||
local sName = EgtGetName( nOutlineId)
|
||||
|
||||
-- se non è definita tipologia
|
||||
if nSashType == WIN_SASHTYPES.NULL then
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_TOP)
|
||||
end
|
||||
|
||||
else
|
||||
-- verifico se deriva da una curva di split di tipo french ( e quindi deve avere profilo speciale e.g. battente/ricevente)
|
||||
local nSouId = EgtGetInfo( nOutlineId, WIN_SOU, 'i')
|
||||
local nSouPrevId
|
||||
local nSplitType
|
||||
@@ -510,18 +566,19 @@ local function CalcProfileType( nAreaId)
|
||||
end
|
||||
end
|
||||
until not nSouId or nSplitType == WIN_SPLITTYPES.FRENCH
|
||||
|
||||
|
||||
if nSplitType == WIN_SPLITTYPES.FRENCH then
|
||||
-- setto info sulla curva per ricordare che deriva da un french split ( utile nel calcolo degli outlines)
|
||||
EgtSetInfo( nOutlineId, WIN_CRV_ON_FRENCH_SPLIT, true)
|
||||
|
||||
-- a) battente/ricevente
|
||||
if nSashType == WIN_SASHTYPES.ACTIVE then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_ACTIVE)
|
||||
elseif nSashType == WIN_SASHTYPES.INACTIVE then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_INACTIVE)
|
||||
elseif nSashType == WIN_SASHTYPES.ACTIVE_OUT or nSashType == WIN_SASHTYPES.INACTIVE_OUT then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRENCH_OUT)
|
||||
else
|
||||
elseif nSashType == WIN_SASHTYPES.ACTIVE_IN or nSashType == WIN_SASHTYPES.INACTIVE_IN then
|
||||
-- devo verificare il tipo dell'anta adiacente
|
||||
local nAdjSashType = FindAdjacentSashType( nSouId, nSouPrevId)
|
||||
if nSashType == WIN_SASHTYPES.ACTIVE_IN then
|
||||
@@ -537,30 +594,53 @@ local function CalcProfileType( nAreaId)
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SASH_INACTIVE)
|
||||
end
|
||||
end
|
||||
|
||||
-- b) alzante scorrevole
|
||||
elseif nSashType == WIN_SASHTYPES.SLIDE_MOVABLE then
|
||||
local nAdjSashType = FindAdjacentSashType( nSouId, nSouPrevId)
|
||||
if nAdjSashType == WIN_SASHTYPES.SLIDE_MOVABLE then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_ACTIVE_IN)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_ACTIVE)
|
||||
end
|
||||
elseif nSashType == WIN_SASHTYPES.SLIDE_FIXED then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_INACTIVE)
|
||||
elseif nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_INACTIVE)
|
||||
end
|
||||
|
||||
else
|
||||
local sName = EgtGetName( nOutlineId)
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_BOTTOM)
|
||||
-- a) alzante scorrevole
|
||||
if nSashType == WIN_SASHTYPES.SLIDE_MOVABLE then
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_MOVABLE_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_MOVABLE_TOP)
|
||||
end
|
||||
elseif nSashType == WIN_SASHTYPES.SLIDE_FIXED then
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_FIXED_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_FIXED_TOP)
|
||||
end
|
||||
elseif nSashType == WIN_SASHTYPES.SLIDE_MOVABLE_BACK then
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_MOVABLE_BACK_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_SLIDE_MOVABLE_BACK_TOP)
|
||||
end
|
||||
|
||||
-- b) standard
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_TOP)
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_TOP)
|
||||
end
|
||||
end
|
||||
end
|
||||
nOutlineId = EgtGetNext( nOutlineId)
|
||||
end
|
||||
else
|
||||
-- imposto profili sash
|
||||
local nOutlineLayerId = EgtGetFirstNameInGroup( nAreaId, WIN_AREAOUTLINE)
|
||||
local nOutlineId = EgtGetFirstInGroup( nOutlineLayerId)
|
||||
while nOutlineId do
|
||||
local sName = EgtGetName( nOutlineId)
|
||||
if sName == WIN_BOTTOM then
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_BOTTOM)
|
||||
else
|
||||
EgtSetInfo( nOutlineId, WIN_PROFILETYPE, WIN_FRAME_TOP)
|
||||
end
|
||||
nOutlineId = EgtGetNext( nOutlineId)
|
||||
end
|
||||
nOutlineId = EgtGetNext( nOutlineId)
|
||||
end
|
||||
|
||||
-- verifico se ci sono split
|
||||
@@ -670,12 +750,22 @@ local function CalculateOutlineFromAreaOutline( nAreaId)
|
||||
TrimSplitWithOutline( nSplitId)
|
||||
-- recupero tipo di profilo
|
||||
local sSplitProfile = EgtGetInfo( nSplitId, WIN_PROFILETYPE)
|
||||
-- se split interno ad anta
|
||||
-- se split interno ad anta devo alzarlo in z come l'anta che lo contiene
|
||||
if sSplitProfile == WIN_SASH_SPLIT then
|
||||
-- recupero profilo usato per anta
|
||||
-- recupero l'anta
|
||||
local nSashAreaId = EgtGetParent( nAreaId)
|
||||
local nAreaType = EgtGetInfo( nSashAreaId, WIN_AREATYPE, 'i')
|
||||
while nAreaType ~= WIN_AREATYPES.SASH do
|
||||
nSashAreaId = EgtGetParent( nSashAreaId)
|
||||
nAreaType = EgtGetInfo( nSashAreaId, WIN_AREATYPE, 'i')
|
||||
end
|
||||
local nSashBaseOutlineLayerId = EgtGetFirstNameInGroup( nSashAreaId, WIN_AREAOUTLINE)
|
||||
local nSashBaseOutlineId = EgtGetFirstInGroup( nSashBaseOutlineLayerId)
|
||||
-- recupero il profilo dell'anta
|
||||
local sSashProfile = EgtGetInfo( nSashBaseOutlineId, WIN_PROFILETYPE)
|
||||
local nProfileLayerId = EgtGetFirstNameInGroup( GDB_ID.ROOT, WIN_PROFILE)
|
||||
local nSashProfileLayerId = EgtGetFirstNameInGroup( nProfileLayerId, WIN_SASH)
|
||||
local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSplitProfile)
|
||||
local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSashProfile)
|
||||
-- calcolo offset sulla z dell'anta
|
||||
local dSashZOffset = EgtGetInfo( nSashProfileId, WIN_DELTA, 'd')
|
||||
-- sposto Split in Z
|
||||
@@ -765,11 +855,12 @@ local function CalculateOutlineFromAreaOutline( nAreaId)
|
||||
-- la taglio con outline
|
||||
TrimSplitWithOutline( nSplitId)
|
||||
|
||||
-- recupero profilo usato per anta
|
||||
local sSplitProfile = EgtGetInfo( nBaseSplitId, WIN_PROFILETYPE)
|
||||
local nSplitProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSplitProfile)
|
||||
-- calcolo offset sulla z dell'anta
|
||||
local dSplitZOffset = EgtGetInfo( nSplitProfileId, WIN_DELTA, 'd')
|
||||
-- calcolo offset sulla z dal profilo dell'anta
|
||||
local nPrevId = EgtGetInfo( nBaseSplitId, WIN_SPLIT_STARTINTERS, 'i')
|
||||
local sSashProfile = EgtGetInfo( nPrevId, WIN_PROFILETYPE)
|
||||
local nSashProfileId = EgtGetFirstNameInGroup( nSashProfileLayerId, sSashProfile)
|
||||
local dSplitZOffset = EgtGetInfo( nSashProfileId, WIN_DELTA, 'd')
|
||||
|
||||
-- sposto split in Z
|
||||
EgtMove( nSplitId, Z_AX() * dSplitZOffset)
|
||||
end
|
||||
@@ -2846,13 +2937,13 @@ local function CreateStripFromOutline( nAreaId, nOutlineId)
|
||||
local nStartStripGuideId = EgtLine( nSolidLayerId, ptStripMinStart, ptStripMaxStart)
|
||||
EgtExtendCurveStartByLen( nStartStripGuideId, 10)
|
||||
EgtExtendCurveEndByLen( nStartStripGuideId, 10)
|
||||
EgtMove( nStartStripGuideId, Z_AX())
|
||||
|
||||
-- estrudo Strip start
|
||||
local b3RefStartProfile = GetProfileLocalBox( nStartProfileId)
|
||||
local nStartStripProfileId = EgtLine( nStartProfileId, ptStripMinStart, ptStripMinStart - Z_AX() * b3RefStartProfile:getDimY(), GDB_RT.GLOB)
|
||||
EgtInvertCurve( nStartStripProfileId)
|
||||
local nStartStripExtrusionId = EgtSurfTmSwept( nSolidLayerId, nStartStripProfileId, nStartStripGuideId, false, WIN_SURF_APPROX)
|
||||
|
||||
local nStartStripExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nStartStripGuideId, - Z_AX() * ( b3RefStartProfile:getDimY() + 2), WIN_SURF_APPROX)
|
||||
EgtInvertSurf( nStartStripExtrusionId)
|
||||
|
||||
-- intersezione con main
|
||||
EgtSurfTmIntersect( nMainStripExtrusionId, nStartStripExtrusionId)
|
||||
|
||||
@@ -2867,22 +2958,20 @@ local function CreateStripFromOutline( nAreaId, nOutlineId)
|
||||
local nEndStripGuideId = EgtLine( nSolidLayerId, ptStripMinEnd, ptStripMaxEnd)
|
||||
EgtExtendCurveStartByLen( nEndStripGuideId, 10)
|
||||
EgtExtendCurveEndByLen( nEndStripGuideId, 10)
|
||||
EgtInvertCurve( nEndStripGuideId)
|
||||
EgtMove( nEndStripGuideId, Z_AX())
|
||||
|
||||
-- estrudo Strip end
|
||||
local b3RefEndProfile = GetProfileLocalBox( nEndProfileId)
|
||||
local nEndStripProfileId = EgtLine( nEndProfileId, ptStripMinEnd, ptStripMinEnd - Z_AX() * b3RefEndProfile:getDimY(), GDB_RT.GLOB)
|
||||
EgtInvertCurve( nEndStripProfileId)
|
||||
local nEndStripExtrusionId = EgtSurfTmSwept( nSolidLayerId, nEndStripProfileId, nEndStripGuideId, false, WIN_SURF_APPROX)
|
||||
|
||||
local nEndStripExtrusionId = EgtSurfTmByExtrusion( nSolidLayerId, nEndStripGuideId, - Z_AX() * ( b3RefEndProfile:getDimY() + 2), WIN_SURF_APPROX)
|
||||
|
||||
-- intersezione con main
|
||||
EgtSurfTmIntersect( nMainStripExtrusionId, nEndStripExtrusionId)
|
||||
|
||||
-- cancello curve e superfici di costruzione
|
||||
EgtErase( nSectionId)
|
||||
EgtErase( { nMainStripMinOffsetId, nMainStripMaxOffsetId})
|
||||
EgtErase( { nStartStripMinOffsetId, nStartStripMaxOffsetId, nStartStripGuideId, nStartStripProfileId, nStartStripExtrusionId})
|
||||
EgtErase( { nEndStripMinOffsetId, nEndStripMaxOffsetId, nEndStripGuideId, nEndStripProfileId, nEndStripExtrusionId})
|
||||
EgtErase( { nStartStripMinOffsetId, nStartStripMaxOffsetId, nStartStripGuideId, nStartStripExtrusionId})
|
||||
EgtErase( { nEndStripMinOffsetId, nEndStripMaxOffsetId, nEndStripGuideId, nEndStripExtrusionId})
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user