mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-04-15 21:21:21 +05:00
"Dump Python". fix for work without a study
This commit is contained in:
parent
d795ab0959
commit
108ee5d360
@ -320,7 +320,8 @@ TCollection_AsciiString SMESH_Gen_i::DumpPython_impl
|
|||||||
anUpdatedScript += "\n";
|
anUpdatedScript += "\n";
|
||||||
|
|
||||||
// Set object names
|
// Set object names
|
||||||
anUpdatedScript += "\n\tisGUIMode = 1";
|
anUpdatedScript += "\n\tisGUIMode = ";
|
||||||
|
anUpdatedScript += isPublished;
|
||||||
anUpdatedScript += "\n\tif isGUIMode:";
|
anUpdatedScript += "\n\tif isGUIMode:";
|
||||||
anUpdatedScript += "\n\t\tsmeshgui = salome.ImportComponentGUI(\"SMESH\")";
|
anUpdatedScript += "\n\t\tsmeshgui = salome.ImportComponentGUI(\"SMESH\")";
|
||||||
anUpdatedScript += "\n\t\tsmeshgui.Init(theStudy._get_StudyId())";
|
anUpdatedScript += "\n\t\tsmeshgui.Init(theStudy._get_StudyId())";
|
||||||
|
@ -528,7 +528,7 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShap
|
|||||||
SALOMEDS::SObject_var aSO =
|
SALOMEDS::SObject_var aSO =
|
||||||
_gen_i->PublishSubMesh(_gen_i->GetCurrentStudy(), aMesh,
|
_gen_i->PublishSubMesh(_gen_i->GetCurrentStudy(), aMesh,
|
||||||
subMesh, aSubShapeObject, theName );
|
subMesh, aSubShapeObject, theName );
|
||||||
|
if ( !aSO->_is_nil()) {
|
||||||
// Update Python script
|
// Update Python script
|
||||||
TCollection_AsciiString aStr (aSO->GetID());
|
TCollection_AsciiString aStr (aSO->GetID());
|
||||||
aStr += " = ";
|
aStr += " = ";
|
||||||
@ -540,6 +540,7 @@ SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::GetSubMesh(GEOM::GEOM_Object_ptr aSubShap
|
|||||||
SMESH_Gen_i::AddToCurrentPyScript(aStr);
|
SMESH_Gen_i::AddToCurrentPyScript(aStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch(SALOME_Exception & S_ex) {
|
catch(SALOME_Exception & S_ex) {
|
||||||
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
|
THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM);
|
||||||
}
|
}
|
||||||
@ -633,7 +634,7 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType
|
|||||||
SALOMEDS::SObject_var aSO =
|
SALOMEDS::SObject_var aSO =
|
||||||
_gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(),
|
_gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(),
|
||||||
aNewGroup, GEOM::GEOM_Object::_nil(), theName);
|
aNewGroup, GEOM::GEOM_Object::_nil(), theName);
|
||||||
|
if ( !aSO->_is_nil()) {
|
||||||
// Update Python script
|
// Update Python script
|
||||||
TCollection_AsciiString aStr (aSO->GetID());
|
TCollection_AsciiString aStr (aSO->GetID());
|
||||||
aStr += " = ";
|
aStr += " = ";
|
||||||
@ -642,6 +643,7 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::CreateGroup( SMESH::ElementType theElemType
|
|||||||
|
|
||||||
SMESH_Gen_i::AddToCurrentPyScript(aStr);
|
SMESH_Gen_i::AddToCurrentPyScript(aStr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return aNewGroup._retn();
|
return aNewGroup._retn();
|
||||||
}
|
}
|
||||||
@ -668,7 +670,7 @@ SMESH::SMESH_GroupOnGeom_ptr SMESH_Mesh_i::CreateGroupFromGEOM (SMESH::ElementTy
|
|||||||
SALOMEDS::SObject_var aSO =
|
SALOMEDS::SObject_var aSO =
|
||||||
_gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(),
|
_gen_i->PublishGroup(_gen_i->GetCurrentStudy(), _this(),
|
||||||
aNewGroup, theGeomObj, theName);
|
aNewGroup, theGeomObj, theName);
|
||||||
|
if ( !aSO->_is_nil()) {
|
||||||
// Update Python script
|
// Update Python script
|
||||||
TCollection_AsciiString aStr (aSO->GetID());
|
TCollection_AsciiString aStr (aSO->GetID());
|
||||||
aStr += " = ";
|
aStr += " = ";
|
||||||
@ -679,6 +681,7 @@ SMESH::SMESH_GroupOnGeom_ptr SMESH_Mesh_i::CreateGroupFromGEOM (SMESH::ElementTy
|
|||||||
SMESH_Gen_i::AddToCurrentPyScript(aStr);
|
SMESH_Gen_i::AddToCurrentPyScript(aStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return aNewGroup._retn();
|
return aNewGroup._retn();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user