EgtExecutor :

- funzione Exe/Lua DuploCount ora considera pezzi validi anche quelli spostati in posizione diversa dalla radice del progetto.
This commit is contained in:
DarioS
2022-01-15 11:21:35 +01:00
parent a06fef3b0c
commit ed611ed6fe
+19 -1
View File
@@ -690,6 +690,24 @@ ExeDuploNew( int nSouId)
return nNewId ;
}
//-----------------------------------------------------------------------------
static bool
IsPartForDuplo( IGeomDB* pGeomDB, int nPartId)
{
// è veramente un pezzo
if ( ExeIsPart( nPartId))
return true ;
// è un pezzo spostato altrove
int nBaseId, nLev ;
if ( pGeomDB->GetInfo( nPartId, GDB_SI_BASE, nBaseId) &&
pGeomDB->GetGdbType( nPartId) == GDB_TY_GROUP &&
pGeomDB->GetParentId( nBaseId) == GDB_ID_ROOT &&
pGeomDB->GetLevel( nPartId, nLev) && nLev == GDB_LV_USER)
return true ;
// altrimenti non è un pezzo
return false ;
}
//-----------------------------------------------------------------------------
bool
ExeDuploCount( int nSouId, int& nCount)
@@ -697,7 +715,7 @@ ExeDuploCount( int nSouId, int& nCount)
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// Verifico sia un pezzo
if ( ! ExeIsPart( nSouId))
if ( ! IsPartForDuplo( pGeomDB, nSouId))
return false ;
// Recupero info del sorgente
INTVECTOR vnRef ;