diff --git a/EXE_NstAutoNesting.cpp b/EXE_NstAutoNesting.cpp index 6cfeafe..5502e01 100644 --- a/EXE_NstAutoNesting.cpp +++ b/EXE_NstAutoNesting.cpp @@ -135,6 +135,22 @@ ExeAutoNestAddDefectToSheet( int nSheetId, int nDefectId) return s_pAutoNester->AddDefectToSheet( nSheetId, Outline) ; } +//----------------------------------------------------------------------------- +bool +ExeAutoNestAddRestrictedZoneToSheet( int nSheetId, int nRstZoneId, int nRzConstrId) +{ + if ( IsNull( s_pAutoNester)) + return false ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + // recupero il contorno della zona ristretta + PolyArc Outline ; + if ( ! MyGetOutline( pGeomDB, nRstZoneId, Outline)) + return false ; + // aggiungo la zona ristretta al pannello + return s_pAutoNester->AddRestrictedZoneToSheet( nRzConstrId, nSheetId, Outline) ; +} + //----------------------------------------------------------------------------- bool ExeAutoNestAddPart( int nPartId, int nOutlineId, bool bCanFlip, bool bCanRotate, double dRotStep, int nPriority, int nCount) @@ -203,6 +219,16 @@ ExeAutoNestAddToolOutlineToPart( int nPartId, int nToolOutlineId) return s_pAutoNester->AddToolOutlineToPart( nPartId, ToolOutline) ; } +//----------------------------------------------------------------------------- +bool +ExeAutoNestSetRestrictedZoneToPart( int nPartId, int nRzConstrId) +{ + if ( IsNull( s_pAutoNester)) + return false ; + // aggiungo il vincolo di zona ristretta al pezzo + return s_pAutoNester->SetRestrictedZoneToPart( nPartId, nRzConstrId) ; +} + //----------------------------------------------------------------------------- bool ExeAutoNestSetInterpartGap( double dGap) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 07863fb..85a6901 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_Nesting.cpp b/LUA_Nesting.cpp index 28b941c..fe07a48 100644 --- a/LUA_Nesting.cpp +++ b/LUA_Nesting.cpp @@ -174,6 +174,25 @@ LuaAutoNestAddDefectToSheet( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaAutoNestAddRestrictedZoneToSheet( lua_State* L) +{ + // 3 parametri : nSheetId, nRstZoneId, nRzConstrId + int nSheetId ; + LuaCheckParam( L, 1, nSheetId) + int nRstZoneId ; + LuaCheckParam( L, 2, nRstZoneId) + int nRzConstrId ; + LuaCheckParam( L, 3, nRzConstrId) + LuaClearStack( L) ; + // aggiungo un difetto al pannello indicato + bool bOk = ExeAutoNestAddRestrictedZoneToSheet( nSheetId, nRstZoneId, nRzConstrId) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaAutoNestAddPart( lua_State* L) @@ -249,6 +268,22 @@ LuaAutoNestAddToolOutlineToPart( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaAutoNestSetRestrictedZoneToPart( lua_State* L) +{ + // 2 parametri : nPartId, nRzConstrId + int nPartId ; + LuaCheckParam( L, 1, nPartId) + int nRzConstrId ; + LuaCheckParam( L, 2, nRzConstrId) + // aggiungo un vincolo di zona protetta al pezzo indicato + bool bOk = ExeAutoNestSetRestrictedZoneToPart( nPartId, nRzConstrId) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaAutoNestSetInterpartGap( lua_State* L) @@ -401,12 +436,14 @@ LuaInstallNesting( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestStart", LuaAutoNestStart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetGuillotineMode", LuaAutoNestSetGuillotineMode) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetStartCorner", LuaAutoNestSetStartCorner) ; - bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddDefectToSheet", LuaAutoNestAddDefectToSheet) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddSheet", LuaAutoNestAddSheet) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddDefectToSheet", LuaAutoNestAddDefectToSheet) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddRestrictedZoneToSheet", LuaAutoNestAddRestrictedZoneToSheet) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddPart", LuaAutoNestAddPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddHoleToPart", LuaAutoNestAddHoleToPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddAnotherOutlineToPart", LuaAutoNestAddAnotherOutlineToPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddToolOutlineToPart", LuaAutoNestAddToolOutlineToPart) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetRestrictedZoneToPart", LuaAutoNestSetRestrictedZoneToPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetInterpartGap", LuaAutoNestSetInterpartGap) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestSetReportFile", LuaAutoNestSetReportFile) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestCompute", LuaAutoNestCompute) ;