diff --git a/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp b/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp index 3ac8b5d5c6..aa9d989198 100644 --- a/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp +++ b/ApplicationCode/Commands/WellLogCommands/RicNewPltPlotFeature.cpp @@ -58,20 +58,15 @@ bool RicNewPltPlotFeature::isCommandEnabled() if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false; RimSimWellInView* simWell = caf::firstAncestorOfTypeFromSelectedObject(); - RimWellPath* rimWellPath = simWell == nullptr ? caf::firstAncestorOfTypeFromSelectedObject() : nullptr; bool enable = true; if (simWell != nullptr) { - RimEclipseResultCase* eclCase = caf::firstAncestorOfTypeFromSelectedObject(); - if (simWell != nullptr) - { - enable &= RimWellPlotTools::hasFlowData(eclCase); - } - } - else if (rimWellPath) - { - enable &= RimWellPlotTools::hasFlowData(rimWellPath); + RimProject* proj = RiaApplication::instance()->project(); + QString simWellName = simWell->name(); + + RimWellPath* wellPath = proj->wellPathFromSimulationWell(simWellName); + enable = wellPath != nullptr; } return enable; } diff --git a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp index 40366fd8b9..4ab5faf5a6 100644 --- a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -235,7 +235,6 @@ QStringList RimContextCommandBuilder::commandsFromSelection() commandIds << "RicNewWellLogFileCurveFeature"; commandIds << "RicNewWellLogCurveExtractionFeature"; commandIds << "RicNewWellPathIntersectionFeature"; - commandIds << "RicNewRftPlotFeature"; } else if (dynamic_cast(uiItem)) { diff --git a/ApplicationCode/UserInterface/RiuViewerCommands.cpp b/ApplicationCode/UserInterface/RiuViewerCommands.cpp index d1967dbace..1e393ceaa0 100644 --- a/ApplicationCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationCode/UserInterface/RiuViewerCommands.cpp @@ -307,6 +307,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) commandIds << "RicNewWellLogCurveExtractionFeature"; commandIds << "RicNewWellLogFileCurveFeature"; commandIds << "RicNewRftPlotFeature"; + commandIds << "RicNewPltPlotFeature"; commandIds << "Separator"; commandIds << "RicNewWellPathIntersectionFeature"; commandIds << "RicNewFishbonesSubsAtMeasuredDepthFeature";