- for( ; anIt!=aLast; anIt++ )
- if( const SMDS_MeshNode * n = aMesh->FindNode( *anIt ) )
- newIndices.Add( n->GetID() );
+ if ( selectionMode() == NodeSelection )
+ for( ; anIt!=aLast; anIt++ ) {
+ if( const SMDS_MeshNode * n = aMesh->FindNode( *anIt ) )
+ newIndices.Add( n->GetID() );
+ }
+ else
+ for( ; anIt!=aLast; anIt++ ) {
+ if( const SMDS_MeshElement* e = aMesh->FindElement( *anIt ) )
+ newIndices.Add( e->GetID() );
+ }