2019-08-19 06:46:14 -05:00
|
|
|
#############################################################
|
|
|
|
# This example will alter the views of all cases
|
|
|
|
# By setting the background color and toggle the grid box
|
2019-08-23 04:25:00 -05:00
|
|
|
# Also clones the first view
|
2019-08-19 06:46:14 -05:00
|
|
|
#############################################################
|
|
|
|
import rips
|
|
|
|
# Connect to ResInsight instance
|
2019-09-19 06:25:04 -05:00
|
|
|
resinsight = rips.Instance.find()
|
2019-08-19 06:46:14 -05:00
|
|
|
|
|
|
|
# Check if connection worked
|
2019-09-19 06:25:04 -05:00
|
|
|
if resinsight is not None:
|
2019-08-19 06:46:14 -05:00
|
|
|
# Get a list of all cases
|
2019-09-19 06:25:04 -05:00
|
|
|
cases = resinsight.project.cases()
|
2019-08-19 06:46:14 -05:00
|
|
|
for case in cases:
|
|
|
|
# Get a list of all views
|
|
|
|
views = case.views()
|
|
|
|
for view in views:
|
|
|
|
# Set some parameters for the view
|
2020-02-21 05:10:02 -06:00
|
|
|
view.show_grid_box = not view.show_grid_box
|
|
|
|
view.background_color = "#3388AA"
|
2019-08-19 06:46:14 -05:00
|
|
|
# Update the view in ResInsight
|
2019-08-23 04:25:00 -05:00
|
|
|
view.update()
|
|
|
|
# Clone the first view
|
2019-09-19 08:14:01 -05:00
|
|
|
new_view = views[0].clone()
|
2020-02-21 05:10:02 -06:00
|
|
|
new_view.background_color = "#FFAA33"
|
2019-09-19 08:14:01 -05:00
|
|
|
new_view.update()
|
2020-02-21 05:10:02 -06:00
|
|
|
view.show_grid_box = False
|
2020-01-28 08:48:50 -06:00
|
|
|
view.set_visible(False)
|
|
|
|
view.update()
|