diff --git a/EXE_GdbPartLayers.cpp b/EXE_GdbPartLayers.cpp index b893715..3c25988 100644 --- a/EXE_GdbPartLayers.cpp +++ b/EXE_GdbPartLayers.cpp @@ -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 ;