Update load_case.py and open_project.py to use test model path in install folder

This commit is contained in:
Gaute Lindkvist 2021-01-14 11:21:25 +01:00
parent 746b542dcf
commit ecd6366e88
2 changed files with 21 additions and 5 deletions

View File

@ -1,11 +1,18 @@
# Access to environment variables and path tools
import os
# Load ResInsight Processing Server Client Library
import rips
# Connect to ResInsight instance
resinsight = rips.Instance.find()
# Load an example case. Needs to be replaced with a valid path!
case = resinsight.project.load_case(
"C:/Users/lindk/Projects/ResInsight/TestModels/TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID")
# This requires the TestModels to be installed with ResInsight (RESINSIGHT_BUNDLE_TESTMODELS):
resinsight_exe_path = os.environ.get('RESINSIGHT_EXECUTABLE')
# Get the TestModels path from the executable path
resinsight_install_path = os.path.dirname(resinsight_exe_path)
test_models_path = os.path.join(resinsight_install_path, 'TestModels')
path_name = os.path.join(test_models_path, 'TEST10K_FLT_LGR_NNC/TEST10K_FLT_LGR_NNC.EGRID')
case = resinsight.project.load_case(path_name)
# Print out lots of information from the case object
print("Case id: " + str(case.id))

View File

@ -1,8 +1,17 @@
# Access to environment variables and path tools
import os
# Load ResInsight Processing Server Client Library
import rips
# Connect to ResInsight instance
resinsight = rips.Instance.find()
# This requires the TestModels to be installed with ResInsight (RESINSIGHT_BUNDLE_TESTMODELS):
resinsight_exe_path = os.environ.get('RESINSIGHT_EXECUTABLE')
# Get the TestModels path from the executable path
resinsight_install_path = os.path.dirname(resinsight_exe_path)
test_models_path = os.path.join(resinsight_install_path, 'TestModels')
path_name = os.path.join(test_models_path, 'TEST10K_FLT_LGR_NNC/10KWithWellLog.rsp')
# Open a project
resinsight.project.open(
"C:/Users/lindk/Projects/ResInsight/TestModels/TEST10K_FLT_LGR_NNC/10KWithWellLog.rsp")
resinsight.project.open(path_name)