diff --git a/EXE_NstAutoNesting.cpp b/EXE_NstAutoNesting.cpp index e8e8305..3fa2169 100644 --- a/EXE_NstAutoNesting.cpp +++ b/EXE_NstAutoNesting.cpp @@ -139,7 +139,23 @@ ExeAutoNestAddPart( int nPartId, int nOutlineId, bool bCanFlip, bool bCanRotate, //----------------------------------------------------------------------------- bool -ExeAddAnotherOutlineToPart( int nPartId, int nAnotherOutlineId) +ExeAutoNestAddHoleToPart( int nPartId, int nHoleId) +{ + if ( IsNull( s_pAutoNester)) + return false ; + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + // recupero un buco del pezzo + PolyArc Hole ; + if ( ! MyGetOutline( pGeomDB, nHoleId, Hole)) + return false ; + // aggiungo un buco al pezzo + return s_pAutoNester->AddHoleToPart( nPartId, Hole) ; +} + +//----------------------------------------------------------------------------- +bool +ExeAutoNestAddAnotherOutlineToPart( int nPartId, int nAnotherOutlineId) { if ( IsNull( s_pAutoNester)) return false ; diff --git a/EXE_NstPartNesting.cpp b/EXE_NstPartNesting.cpp index a8fc5ec..a3305cf 100644 --- a/EXE_NstPartNesting.cpp +++ b/EXE_NstPartNesting.cpp @@ -2137,7 +2137,7 @@ ExeAutomaticPackParts( INTVECTOR& vIds, bool bMinimizeOnXvsY, bool bReducedCut, // recupero eventuale regione in basso del pezzo int nDwnRegId = GetFlatPartDownRegion( pGeomDB, nPartId) ; if ( nDwnRegId != GDB_ID_NULL) - ExeAddAnotherOutlineToPart( nPartId, nDwnRegId) ; + ExeAutoNestAddAnotherOutlineToPart( nPartId, nDwnRegId) ; // recupero regioni dei tagli del pezzo INTVECTOR vCutReg ; if ( ! GetFlatPartCutRegions( pGeomDB, nPartId, bReducedCut, vCutReg)) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index ffe275b..64a1b7b 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/LUA_Nesting.cpp b/LUA_Nesting.cpp index a51e42e..e239ccd 100644 --- a/LUA_Nesting.cpp +++ b/LUA_Nesting.cpp @@ -171,6 +171,22 @@ LuaAutoNestAddPart( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaAutoNestAddHoleToPart( lua_State* L) +{ + // 2 parametri : nPartId, nHoleId + int nPartId ; + LuaCheckParam( L, 1, nPartId) + int nHoleId ; + LuaCheckParam( L, 2, nHoleId) + // aggiungo un buco al pezzo indicato + bool bOk = ExeAutoNestAddHoleToPart( nPartId, nHoleId) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- static int LuaAutoNestAddAnotherOutlineToPart( lua_State* L) @@ -181,7 +197,7 @@ LuaAutoNestAddAnotherOutlineToPart( lua_State* L) int nAnotherOutlineId ; LuaCheckParam( L, 2, nAnotherOutlineId) // aggiungo un contorno aggiuntivo al pezzo indicato - bool bOk = ExeAddAnotherOutlineToPart( nPartId, nAnotherOutlineId) ; + bool bOk = ExeAutoNestAddAnotherOutlineToPart( nPartId, nAnotherOutlineId) ; // restituisco il risultato LuaSetParam( L, bOk) ; return 1 ; @@ -341,6 +357,7 @@ LuaInstallNesting( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddDefectToSheet", LuaAutoNestAddDefectToSheet) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAutoNestAddSheet", LuaAutoNestAddSheet) ; 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( "EgtAutoNestSetInterpartGap", LuaAutoNestSetInterpartGap) ;