2019-08-19 13:46:14 +02:00
|
|
|
#############################################################
|
|
|
|
|
# This example will alter the views of all cases
|
|
|
|
|
# By setting the background color and toggle the grid box
|
2019-08-23 11:25:00 +02:00
|
|
|
# Also clones the first view
|
2019-08-19 13:46:14 +02:00
|
|
|
#############################################################
|
|
|
|
|
import rips
|
|
|
|
|
# Connect to ResInsight instance
|
2019-09-19 13:25:04 +02:00
|
|
|
resinsight = rips.Instance.find()
|
2019-08-19 13:46:14 +02:00
|
|
|
|
|
|
|
|
# Check if connection worked
|
2019-09-19 13:25:04 +02:00
|
|
|
if resinsight is not None:
|
2019-08-19 13:46:14 +02:00
|
|
|
# Get a list of all cases
|
2019-09-19 13:25:04 +02:00
|
|
|
cases = resinsight.project.cases()
|
2019-08-19 13:46:14 +02:00
|
|
|
for case in cases:
|
|
|
|
|
# Get a list of all views
|
|
|
|
|
views = case.views()
|
|
|
|
|
for view in views:
|
|
|
|
|
# Set some parameters for the view
|
|
|
|
|
view.setShowGridBox(not view.showGridBox())
|
|
|
|
|
view.setBackgroundColor("#3388AA")
|
|
|
|
|
# Update the view in ResInsight
|
2019-08-23 11:25:00 +02:00
|
|
|
view.update()
|
|
|
|
|
# Clone the first view
|
|
|
|
|
newView = views[0].clone()
|
|
|
|
|
view.setShowGridBox(False)
|
|
|
|
|
newView.setBackgroundColor("#FFAA33")
|
|
|
|
|
newView.update()
|