I want to align the 3D view like the menu item "View/Align View/Center Cursor and View All" does it, but with Python. If in "Scripting" layout this works fine with the following code:
import bpy
override = {}
override['window'] = bpy.context.window
override['scene' ] = bpy.context.scene
override['screen'] = bpy.context.screen
override['area' ] = bpy.context.screen.areas[2]
override['region'] = bpy.context.screen.areas[2].regions[4]
bpy.ops.view3d.view_all(override, center = True)
But it does not work if the view is in quadview mode; only the view in the lower left corner is aligned then. I tried to replace the region line by
override['region'] = bpy.context.screen.areas[2].space.active.region_quadviews[x]
(x = 0..3) but this fails because the region_quadviews[x] are of type RegionView3D instead of type Region. Is it possible to get four regions of type Region of a quadview?
Strange: Clicking on the menu item shows the same behaviour, i. e. only the lower left view is aligned; but using the shortcut (Shift-C) aligns the view the mousepointer is over - this is my goal.