diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 6a5e4f00d7..13549750fd 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -1428,7 +1428,7 @@ RicMswExportInfo const std::vector& fractures) { const RigMainGrid* grid = caseToApply->eclipseCaseData()->mainGrid(); - + const RigActiveCellInfo* activeCellInfo = caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL); RiaEclipseUnitTools::UnitSystem unitSystem = caseToApply->eclipseCaseData()->unitsType(); const RigWellPath* wellPathGeometry = wellPath->wellPathGeometry(); @@ -1444,9 +1444,16 @@ RicMswExportInfo { initialMD = wellPath->fractureCollection()->manualReferenceMD(); } - else if (!intersections.empty()) + else { - initialMD = intersections.front().startMD; + for (WellPathCellIntersectionInfo intersection : intersections) + { + if (activeCellInfo->isActive(intersection.globCellIndex)) + { + initialMD = intersection.startMD; + break; + } + } } RicMswExportInfo exportInfo(wellPath,