- _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
- SMESHGUI_PrecomputeOp::getAssignedAlgos( so, modeMap );
+ _PTR(SObject) meshSO = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() );
+
+ _PTR(SComponent) component = meshSO->GetFatherComponent();
+ if ( meshSO->Depth() - component->Depth() > 1 ) // sub-mesh, get a mesh
+ while ( meshSO->Depth() - component->Depth() > 1 )
+ meshSO = meshSO->GetFather();
+
+ SMESHGUI_PrecomputeOp::getAssignedAlgos( meshSO, modeMap );