# Question about using slice in pvpython

**URL:** https://discourse.paraview.org/t/question-about-using-slice-in-pvpython/3897
**Category:** ParaView Support
**Created:** [March 26, 2020, 7:35pm UTC](https://discourse.paraview.org/t/question-about-using-slice-in-pvpython/3897 "2020-03-26T19:35:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tabeach](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e5b9ba/32.png) [@tabeach](https://discourse.paraview.org/u/tabeach)
#### Post date: [March 26, 2020, 7:35pm UTC](https://discourse.paraview.org/t/question-about-using-slice-in-pvpython/3897/1 "2020-03-26T19:35:56Z")

</div>

I’ve used Slice and IntegrateVariables/SurfaceFlow using Pot3d Datasets for post processing. I’ve tried to extend that by creating new Arrays beyond the 5 variables initially read in. I can use Calculator for simple equations but some of my computations are more involved. I’ve included some pseudo code below that works in the GUI using the programmable Filter (with minor changes). I can’t make it work in pvpython. Referring to the code - I have my new Arrays included in a vtkMultiBlockDataSet (rc). Slice won’t operate on this. Slice operates on p3d, which doesn’t include my new Arrays.

Does this make sense to anybody that can point to a way to handle this? I’ll bet it’s simple but it escapes me.  
Thanks

```
**p3d=PLOT3DReader**
**rc = servermanager.Fetch(p3d)**
**nb = rc.GetNumberOfBlocks()**

**for ib in range(nb):**
**b = rc.GetBlock(ib)**
**pd =b.GetPointData()**
**dvdata = pd.GetAbstractArray('Density')**
**pvdata = vtk.vtkFloatArray()**
**pvdata.DeepCopy(dvdata)**
**np = b.GetNumberOfPoints()**
**for ip in range(np):**
**	pvdata.SetTuple(ip,new_value)**

**pvdata.SetName('StaticPressure')**
**pd.AddArray(pvdata)**

**slice1=slice(rc)**. #doesn't work
**iv=IntegrateVariables(slice1)**
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 27, 2020, 2:38am UTC](https://discourse.paraview.org/t/question-about-using-slice-in-pvpython/3897/2 "2020-03-27T02:38:18Z")

</div>

> [@tabeach](#):
>
> GUI using the programmable Filter (with minor changes). I can’t make it work in pvpython.

ProgrammableFilter is VTKPython  
**pvpython is not VTKPython**

you can’t mix them.
