diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp index bdfde6f171..b7952aae20 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationCollection.cpp @@ -33,6 +33,9 @@ #include "Riu3DMainWindowTools.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" + CAF_PDM_SOURCE_INIT( RimPerforationCollection, "PerforationCollection" ); //-------------------------------------------------------------------------------------------------- @@ -40,12 +43,12 @@ CAF_PDM_SOURCE_INIT( RimPerforationCollection, "PerforationCollection" ); //-------------------------------------------------------------------------------------------------- RimPerforationCollection::RimPerforationCollection() { - CAF_PDM_InitObject( "Perforations", ":/PerforationIntervals16x16.png" ); + CAF_PDM_InitScriptableObject( "Perforations", ":/PerforationIntervals16x16.png" ); nameField()->uiCapability()->setUiHidden( true ); setName( "Perforations" ); - CAF_PDM_InitFieldNoDefault( &m_perforations, "Perforations", "Perforations" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_perforations, "Perforations", "Perforations" ); m_perforations.uiCapability()->setUiTreeHidden( true ); CAF_PDM_InitFieldNoDefault( &m_nonDarcyParameters, "NonDarcyParameters", "Non-Darcy Parameters" ); diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp index b3290f341a..ebc3efdaa3 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimPerforationInterval.cpp @@ -32,6 +32,7 @@ #include "RimWellPath.h" #include "RimWellPathValve.h" +#include "cafPdmFieldScriptingCapability.h" #include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiDateEditor.h" #include "cafPdmUiDoubleSliderEditor.h" @@ -45,10 +46,10 @@ RimPerforationInterval::RimPerforationInterval() { CAF_PDM_InitScriptableObject( "Perforation", ":/PerforationInterval16x16.png" ); - CAF_PDM_InitField( &m_startMD, "StartMeasuredDepth", 0.0, "Start MD" ); - CAF_PDM_InitField( &m_endMD, "EndMeasuredDepth", 0.0, "End MD" ); - CAF_PDM_InitField( &m_diameter, "Diameter", 0.216, "Diameter" ); - CAF_PDM_InitField( &m_skinFactor, "SkinFactor", 0.0, "Skin Factor" ); + CAF_PDM_InitScriptableField( &m_startMD, "StartMeasuredDepth", 0.0, "Start MD" ); + CAF_PDM_InitScriptableField( &m_endMD, "EndMeasuredDepth", 0.0, "End MD" ); + CAF_PDM_InitScriptableField( &m_diameter, "Diameter", 0.216, "Diameter" ); + CAF_PDM_InitScriptableField( &m_skinFactor, "SkinFactor", 0.0, "Skin Factor" ); CAF_PDM_InitField( &m_startOfHistory_OBSOLETE, "StartOfHistory", true, "All Timesteps" ); m_startOfHistory_OBSOLETE.xmlCapability()->setIOWritable( false ); diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp index 4ca2e41be4..27b6b5e0b4 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimWellPathCompletions.cpp @@ -36,6 +36,8 @@ #include "cvfAssert.h" #include "cafPdmDoubleStringValidator.h" +#include "cafPdmFieldScriptingCapability.h" +#include "cafPdmObjectScriptingCapability.h" #include "cafPdmUiDoubleValueEditor.h" #include "cafPdmUiLineEditor.h" #include "cafPdmUiTreeOrdering.h" @@ -49,9 +51,9 @@ CAF_PDM_SOURCE_INIT( RimWellPathCompletions, "WellPathCompletions" ); //-------------------------------------------------------------------------------------------------- RimWellPathCompletions::RimWellPathCompletions() { - CAF_PDM_InitObject( "Completions", ":/CompletionsSymbol16x16.png" ); + CAF_PDM_InitScriptableObject( "Completions", ":/CompletionsSymbol16x16.png" ); - CAF_PDM_InitFieldNoDefault( &m_perforationCollection, "Perforations", "Perforations" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_perforationCollection, "Perforations", "Perforations" ); m_perforationCollection = new RimPerforationCollection; m_perforationCollection.uiCapability()->setUiTreeHidden( true ); diff --git a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp index de9e8094ca..bc026fb3be 100644 --- a/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp +++ b/ApplicationLibCode/ProjectDataModel/WellPath/RimWellPath.cpp @@ -125,7 +125,7 @@ RimWellPath::RimWellPath() CAF_PDM_InitField( &m_wellPathRadiusScaleFactor, "WellPathRadiusScale", 1.0, "Well Path Radius Scale" ); CAF_PDM_InitField( &m_wellPathColor, "WellPathColor", cvf::Color3f( 0.999f, 0.333f, 0.999f ), "Well Path Color" ); - CAF_PDM_InitFieldNoDefault( &m_completions, "Completions", "Completions" ); + CAF_PDM_InitScriptableFieldNoDefault( &m_completions, "Completions", "Completions" ); m_completions = new RimWellPathCompletions; m_completions.uiCapability()->setUiTreeHidden( true ); diff --git a/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py b/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py index 134a34f81c..ba29d56c30 100644 --- a/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py +++ b/GrpcInterface/Python/rips/PythonExamples/modeled_well_path.py @@ -32,3 +32,16 @@ coord = [1054.28, 250, -50] target = geometry.append_well_target(coord) well_path.append_perforation_interval(3300, 3350, 0.2, 0.76) + + +# Update skin factor of the perforation +perforation_coll = well_path.completions().perforations() +perforation = perforation_coll.perforations()[0] +new_skin_factor = 0.9 +print( + "Changing perforation skin factor from {} to {}.".format( + perforation.skin_factor, new_skin_factor + ) +) +perforation.skin_factor = new_skin_factor +perforation.update()