diff --git a/Designing/WinLib/WinCreate.lua b/Designing/WinLib/WinCreate.lua index dd6130e..47260f5 100644 --- a/Designing/WinLib/WinCreate.lua +++ b/Designing/WinLib/WinCreate.lua @@ -133,7 +133,7 @@ local function CreateFrameCurves( nLayerId, nType, vDim) -- vDim[1] larghezza, vDim[2] altezza complessiva -- verifico che altezza sia sensata if vDim[2] < 0.5 * vDim[1] + GEO.EPS_SMALL then - return + return false end local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0)) EgtSetName( nBottomId, WIN_BOTTOM) @@ -149,7 +149,7 @@ local function CreateFrameCurves( nLayerId, nType, vDim) -- vDim[1] larghezza, vDim[2] altezza dei lati verticali, vDim[3] altezza complessiva -- controllo che non degeneri in arco a tutto sesto if vDim[3] - vDim[2] > 0.5 * vDim[1] - GEO.EPS_SMALL then - return + return false end local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0)) EgtSetName( nBottomId, WIN_BOTTOM) @@ -165,7 +165,7 @@ local function CreateFrameCurves( nLayerId, nType, vDim) -- vDim[1] larghezza, vDim[2] altezza dei lati verticali, vDim[3] altezza complessiva, vDim[4] raggio di raccordo -- controllo sulle dimensioni if vDim[3] - vDim[2] > 0.5 * vDim[1] - GEO.EPS_SMALL or vDim[4] > 0.5 * vDim[1] - GEO.EPS_SMALL then - return + return false end local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0)) EgtSetName( nBottomId, WIN_BOTTOM) @@ -188,7 +188,7 @@ local function CreateFrameCurves( nLayerId, nType, vDim) -- vDim[1] larghezza, vDim[2] altezza dei lati verticali, vDim[3] altezza complessiva -- verifico che le due altezze abbiano valori sensati per realizzare i due archi if vDim[3] - vDim[2] < 0.5 * vDim[1] then - return + return false end local nBottomId = EgtLine( nLayerId, ORIG(), Point3d( vDim[1], 0, 0)) EgtSetName( nBottomId, WIN_BOTTOM) @@ -221,6 +221,7 @@ local function CreateFrameCurves( nLayerId, nType, vDim) EgtSetName( nEdge2Id, WIN_TOP) end end + return true end ---------------------------------------------------------------------------------- @@ -237,7 +238,9 @@ function WinCreate.CreateFrame( nType, vJoints, vDimensions, nAreaNbr) -- costruisco le curve di outline local nOutlineLayerId = EgtGroup( nAreaId) EgtSetName( nOutlineLayerId, WIN_AREAOUTLINE) - CreateFrameCurves( nOutlineLayerId, nType, vDimensions) + if not CreateFrameCurves( nOutlineLayerId, nType, vDimensions) then + return + end EgtSetInfo( nAreaId, WIN_FRAME_TYPE, nType) -- imposto tipo giunzioni EgtSetInfo( nOutlineLayerId, WIN_JOINTS, vJoints) diff --git a/Designing/WinLib/WinManageProject.lua b/Designing/WinLib/WinManageProject.lua index 633c1b4..ebaebc0 100644 --- a/Designing/WinLib/WinManageProject.lua +++ b/Designing/WinLib/WinManageProject.lua @@ -196,6 +196,9 @@ local function ConvertTableToGeometry( AreaTable, nParentId) -- creo il telaio local nAreaId = WinCreate.CreateFrame( nType, vJoints, vDim, nAreaNbr) + if not nAreaId then + return + end -- verifico presenza bottomrail if AreaTable[JWD_BOTTOMRAIL] then @@ -353,9 +356,8 @@ function WinManageProject.ReadFromFile( sFilePath, sProfileDir) end -- creo le aree - ConvertTableToGeometry( tData[JWD_AREA_LIST][1], GDB_ID.ROOT) + return ConvertTableToGeometry( tData[JWD_AREA_LIST][1], GDB_ID.ROOT) - return true end ---------------------------------------------------------------------