mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-31 09:14:11 -05:00
#7068 Fix missing import surface File -> Import Surface
This commit is contained in:
1 parent
b9843e0c91
commit
1811c60e2f
1 file changed
+15
-4
@@ -62,11 +62,22 @@ void RicImportSurfacesFeature::onActionTriggered( bool isChecked )
|
||||
app->setLastUsedDialogDirectory( "BINARY_GRID", QFileInfo( fileNames.last() ).absolutePath() );
|
||||
|
||||
// Find the selected SurfaceCollection
|
||||
std::vector<RimSurfaceCollection*> colls = caf::selectedObjectsByTypeStrict<RimSurfaceCollection*>();
|
||||
if ( colls.empty() ) return;
|
||||
RimSurfaceCollection* surfColl = colls[0];
|
||||
RimSurfaceCollection* surfColl = nullptr;
|
||||
{
|
||||
std::vector<RimSurfaceCollection*> colls = caf::selectedObjectsByTypeStrict<RimSurfaceCollection*>();
|
||||
if ( !colls.empty() )
|
||||
{
|
||||
surfColl = colls.front();
|
||||
}
|
||||
}
|
||||
|
||||
// For each file,
|
||||
if ( !surfColl )
|
||||
{
|
||||
auto proj = RimProject::current();
|
||||
surfColl = proj->activeOilField()->surfaceCollection();
|
||||
}
|
||||
|
||||
if ( !surfColl ) return;
|
||||
|
||||
RimSurface* lastCreatedOrUpdated = surfColl->importSurfacesFromFiles( fileNames );
|
||||
|
||||
|
||||
Reference in new issue
Block a user