int obj = myDlg->getActiveObject();
removeCustomFilters(); // Issue 0020170
- // Set Geometry
- QStringList aList;
- myDlg->selectedObject( SMESHGUI_MeshDlg::Geom, aList );
- if (aList.count() != 0)
- aCreator->setShapeEntry( aList.first() );
- else
- aCreator->setShapeEntry( QString() );
-
+ // Get Entry of the Geom object
+ QString anObjEntry = "";
+ anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
+ if ( anObjEntry == "" ) {
+ anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
+ _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
+ anObjEntry = aGeomVar->GetStudyEntry();
+ }
+
+ aCreator->setShapeEntry( anObjEntry );
myDlg->setEnabled( false );
aCreator->create(initParamHyp, aHypName, myDlg);
onActivateObject( obj ); // Issue 0020170. Restore filters
getInitParamsHypothesis( aHyp->GetName(), aHyp->GetLibName());
aCreator->setInitParamsHypothesis( initParamHyp );
- // Set Geometry
- QStringList aList;
- myDlg->selectedObject( SMESHGUI_MeshDlg::Geom, aList );
- if (aList.count() > 0)
- aCreator->setShapeEntry( aList.first() );
- else
- aCreator->setShapeEntry( "" );
+ // Get Entry of the Geom object
+ QString anObjEntry = "";
+ anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom );
+ if ( anObjEntry == "" ) {
+ anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj );
+ _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.toLatin1().data() );
+ GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj );
+ anObjEntry = aGeomVar->GetStudyEntry();
+ }
+ aCreator->setShapeEntry( anObjEntry );
int obj = myDlg->getActiveObject();
removeCustomFilters(); // Issue 0020170
myDlg->setEnabled( false );
if ( !CORBA::is_nil( aGeomFatherObj ) ) {
// Get Main Shape
GEOM::GEOM_Object_var aGeomMain = GetGeomObjectByEntry( myEntry );
- if ( !CORBA::is_nil( aGeomMain ) || aGeomMain->GetType() == 37 ) { // Main Shape is a Group
+ if ( !CORBA::is_nil( aGeomMain ) && aGeomMain->GetType() == 37 ) { // Main Shape is a Group
GEOM::GEOM_Object_ptr aMainFatherObj = aGeomMain->GetMainShape();
if ( !CORBA::is_nil( aMainFatherObj ) )
aMainFatherEntry = aMainFatherObj->GetStudyEntry();