EgtExecutor :
- funzione Exe/Lua DuploCount ora considera pezzi validi anche quelli spostati in posizione diversa dalla radice del progetto.
This commit is contained in:
+19
-1
@@ -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 ;
|
||||
|
||||
Reference in New Issue
Block a user