diff --git a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp index 37188d5123..c27f9e2b1b 100644 --- a/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp +++ b/ApplicationCode/Commands/CompletionCommands/RicWellPathExportCompletionDataFeature.cpp @@ -152,6 +152,28 @@ void RicWellPathExportCompletionDataFeature::exportCompletions(const std::vector return; } + { + bool unitSystemMismatch = false; + for (const RimWellPath* wellPath : wellPaths) + { + if (wellPath->unitSystem() == RimUnitSystem::UNITS_FIELD && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_FIELD) + { + unitSystemMismatch = true; + break; + } + else if (wellPath->unitSystem() == RimUnitSystem::UNITS_METRIC && exportSettings.caseToApply->eclipseCaseData()->unitsType() != RigEclipseCaseData::UNITS_METRIC) + { + unitSystemMismatch = true; + break; + } + } + if (unitSystemMismatch) + { + RiaLogging::error("Well path unit systems must match unit system of chosen eclipse case."); + return; + } + } + QTextStream stream(&exportFile); RifEclipseDataTableFormatter formatter(stream);