#14772 Python: Add WellPath.export_geometry as object method and forward exportWellPaths to it

RimWellPath_exportGeometry writes the well path to a .dev file in an
explicit folder. RicfExportWellPaths resolves the well path names (empty
means all) and the WELLPATHS export folder from the command file
executor, then forwards to it per well path.
Project.export_well_paths() in Python is kept and emits a
DeprecationWarning.
This commit is contained in:
Kristian Bendiksen committed 2026-09-22 14:19:23 +02:00
1 parent 147a60ceec
commit e3e09c0d1f
5 files changed
+118 -39

No files matched your search

@@ -18,6 +18,7 @@
#include "RimcWellPath.h"
#include "ExportCommands/RicExportSelectedWellPathsFeature.h"
#include "FractureCommands/RicNewWellPathFractureFeature.h"
#include "FractureCommands/RicPlaceThermalFractureUsingTemplateDataFeature.h"
@@ -856,3 +857,56 @@ QString RimcWellPath_addIcvValve::classKeywordReturnedType() const
{
return RimWellPathValve::classKeywordStatic();
}
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimWellPath, RimWellPath_exportGeometry, "exportGeometry" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellPath_exportGeometry::RimWellPath_exportGeometry( caf::PdmObjectHandle* self )
: caf::PdmVoidObjectMethod( self )
{
CAF_PDM_InitObject( "Export Geometry", "", "", "Export the well path geometry to a .dev file named after the well path" );
CAF_PDM_InitScriptableField( &m_exportFolder,
"ExportFolder",
QString(),
"Export Folder",
"",
"",
"Folder to write the .dev file to. Created if it does not exist." );
CAF_PDM_InitScriptableField( &m_mdStepSize, "MdStepSize", 5.0, "MD Step Size", "", "", "Resolution of the exported well path along measured depth" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath_exportGeometry::setExportFolder( const QString& exportFolder )
{
m_exportFolder = exportFolder;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellPath_exportGeometry::setMdStepSize( double mdStepSize )
{
m_mdStepSize = mdStepSize;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::expected<caf::PdmObjectHandle*, QString> RimWellPath_exportGeometry::execute()
{
auto* wellPath = self<RimWellPath>();
if ( !wellPath ) return std::unexpected( "No well path is available." );
if ( m_exportFolder().isEmpty() ) return std::unexpected( "No export folder specified." );
if ( m_mdStepSize() <= 0.0 ) return std::unexpected( "MD step size must be positive." );
const bool writeProjectInfo = false;
RicExportSelectedWellPathsFeature::exportWellPath( wellPath, m_mdStepSize(), m_exportFolder(), writeProjectInfo );
return nullptr;
}