New method was not working when mesh was removed

This commit is contained in:
yoann.audouin 2024-01-04 14:10:43 +01:00
parent a1fec70458
commit 551c946e0e
2 changed files with 8 additions and 1 deletions

View File

@ -1092,6 +1092,14 @@ void _pyGen::Process( const Handle(_pyCommand)& theCommand )
theCommand->RemoveArgs();
id_mesh->second->Process( theCommand );
id_mesh->second->AddProcessedCmd( theCommand );
// Changing command for compute adding a check on isDone and raising
// exception if not completed
_AString meshStr = theCommand->GetObject().ToCString();
_AString excStr = "\"Could not compute mesh: \"+";
excStr += meshStr + ".GetName()";
_AString compStr = theCommand->GetString()+"\nif not isDone:\n\traise Exception("+excStr+")";
theCommand->GetString() = compStr;
return;
}
}

View File

@ -2079,7 +2079,6 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh,
// Update Python script
TPythonDump(this) << "isDone = " << this << ".Compute( "
<< theMesh << ", " << theShapeObject << ")";
TPythonDump(this) << "if not isDone: \n raise Exception(\"Issue while computing Mesh\")";
try {
// get mesh servant