# pvpython layout1.SplitHorizontal

**URL:** https://discourse.paraview.org/t/pvpython-layout1-splithorizontal/8797
**Category:** ParaView Support
**Tags:** python
**Created:** [January 19, 2022, 3:38pm UTC](https://discourse.paraview.org/t/pvpython-layout1-splithorizontal/8797 "2022-01-19T15:38:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![LuFuchs](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/bcef8e/32.png) [@LuFuchs](https://discourse.paraview.org/u/LuFuchs)
#### Post date: [January 19, 2022, 3:38pm UTC](https://discourse.paraview.org/t/pvpython-layout1-splithorizontal/8797/1 "2022-01-19T15:38:11Z")

</div>

Hello everybody,

I am trying to automate some visualizations with Paraview using pvpython. For some postprocessing routines it works very nicely (I use paraview version 5.10.0-RC2 on a linux machine).

I want to create and save a screenshot of multiple views in one layout. I tracked the steps with the trace and running the script in the paraview python shell works fine and I do get the plot I want.

Running the script with pvpython in a bash shell however, gives me following error:  
pvpython GetMapView\_Test.py  
Traceback (most recent call last):  
File “GetMapView\_Test.py”, line 357, in   
layout1.SplitHorizontal(0, 0.5)  
AttributeError: ‘NoneType’ object has no attribute ‘SplitHorizontal’

Thanks for any help!

Best,

Lukas

A little snipped of the Code is below:

#### disable automatic camera reset on ‘Show’

paraview.simple.\_DisableFirstRenderCameraReset()

…

# get animation scene

animationScene1 = GetAnimationScene()

# update animation scene based on data timesteps

animationScene1.UpdateAnimationUsingDataTimeSteps()

# get the material library

materialLibrary1 = GetMaterialLibrary()

# Create a new ‘Render View’

renderView1 = CreateView(‘RenderView’)  
renderView1.AxesGrid = ‘GridAxes3DActor’  
renderView1.StereoType = ‘Crystal Eyes’  
renderView1.CameraFocalDisk = 1.0  
renderView1.BackEnd = ‘OSPRay raycaster’  
renderView1.OSPRayMaterialLibrary = materialLibrary1

# show data in view

Display = Show(pvd, renderView1, ‘UniformGridRepresentation’)

…

## get layout

layout1 = GetLayoutByName(“Layout #1”)

# add view to a layout so it’s visible in UI

AssignViewToLayout(view=renderView1, layout=layout1, hint=0)

# reset view to fit data

renderView1.ResetCamera(False)

## update the view to ensure updated data information

renderView1.Update()

…

# set active view

SetActiveView(renderView1)

# update the view to ensure updated data information

renderView1.Update()

#print(layout1)

# split cell

layout1.SplitHorizontal(0, 0.5)
