diff --git a/ApplicationCode/Commands/RicNewSimWellFractureAtPosFeature.cpp b/ApplicationCode/Commands/RicNewSimWellFractureAtPosFeature.cpp index 915ee38140..17b09846f1 100644 --- a/ApplicationCode/Commands/RicNewSimWellFractureAtPosFeature.cpp +++ b/ApplicationCode/Commands/RicNewSimWellFractureAtPosFeature.cpp @@ -55,12 +55,8 @@ void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked) RiuSelectionManager* riuSelManager = RiuSelectionManager::instance(); RiuSelectionItem* selItem = riuSelManager->selectedItem(RiuSelectionManager::RUI_TEMPORARY); - RiuSimWellSelectionItem* simWellItem = nullptr; - if (selItem->type() == RiuSelectionItem::SIMWELL_SELECTION_OBJECT) - { - simWellItem = static_cast(selItem); - if (!simWellItem) return; - } + RiuSimWellSelectionItem* simWellItem = static_cast(selItem); + if (!simWellItem) return; RimEclipseWell* simWell = simWellItem->m_simWell; if (!simWell) return; diff --git a/ApplicationCode/UserInterface/RiuViewerCommands.cpp b/ApplicationCode/UserInterface/RiuViewerCommands.cpp index 1cf874f6be..915afb15ce 100644 --- a/ApplicationCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationCode/UserInterface/RiuViewerCommands.cpp @@ -321,6 +321,9 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) { caf::SelectionManager::instance()->setSelectedItem(well); + RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo->well(), m_currentPickPositionInDomainCoords, eclipseWellSourceInfo->branchIndex()); + RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY); + commandIds << "RicNewWellLogCurveExtractionFeature"; commandIds << "RicShowWellAllocationPlotFeature"; commandIds << "RicPlotProductionRateFeature"; @@ -328,10 +331,6 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) commandIds << "RicShowContributingWellsFeature"; commandIds << "Separator"; commandIds << "RicNewSimWellIntersectionFeature"; - - - RiuSelectionItem* selItem = new RiuSimWellSelectionItem(eclipseWellSourceInfo->well(), m_currentPickPositionInDomainCoords, eclipseWellSourceInfo->branchIndex()); - RiuSelectionManager::instance()->setSelectedItem(selItem, RiuSelectionManager::RUI_TEMPORARY); commandIds << "RicPlotProductionRateFeature"; #ifdef USE_PROTOTYPE_FEATURE_FRACTURES commandIds << "RicNewSimWellFractureAtPosFeature";