EgtExecutor 2.3l2 :

- aggiunte funzioni Exe e Lua AutoNestAddRestrictedZoneToSheet e AutoNestSetRestrictedZoneToPart.
This commit is contained in:
DarioS
2021-12-06 16:50:13 +01:00
parent a828cf0b54
commit 4c45b9435a
3 changed files with 64 additions and 1 deletions
+26
View File
@@ -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)
BIN
View File
Binary file not shown.
+38 -1
View File
@@ -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) ;