# extracting section of grid by specific values of field

**URL:** https://discourse.paraview.org/t/extracting-section-of-grid-by-specific-values-of-field/17424
**Category:** ParaView Support
**Created:** [February 3, 2026, 7:09am UTC](https://discourse.paraview.org/t/extracting-section-of-grid-by-specific-values-of-field/17424 "2026-02-03T07:09:53Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [February 3, 2026, 7:09am UTC](https://discourse.paraview.org/t/extracting-section-of-grid-by-specific-values-of-field/17424/1 "2026-02-03T07:09:53Z")

</div>

Hello,  
I am have a specific need (in python): lets say i have a grid, with pressure values, and i want to extract the section where the pressure has specific values, [1,2,5] without other values, so threshold is out of the table as it will find a ‘section’.  
my current approach (which works) is: using  
`QuerySelect(QueryString=f'(in1d({fieldName}, {listOfValues}))', FieldType=FieldType, InsideOut=False)`  
this will select the desired elements `FieldType` and then i can use extract selection.  
it works, it is reliable but i would like to ask two questions in this regards:

1. is there a more efficient way to do this? before i tested with a programable filter that will loop over all FielType elements which is ‘meh…’ in terms of performance.
2. is there a way to do exactly this without the dependence of the renderviewer? (if i dont have a renderviewer open this will not work)

thanks in advance!

---

<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: [February 3, 2026, 8:04am UTC](https://discourse.paraview.org/t/extracting-section-of-grid-by-specific-values-of-field/17424/2 "2026-02-03T08:04:14Z")

</div>

Is your data a double or an integer ?

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [February 3, 2026, 8:07am UTC](https://discourse.paraview.org/t/extracting-section-of-grid-by-specific-values-of-field/17424/3 "2026-02-03T08:07:20Z")

</div>

was looking for the two, currently it is actually integer, but wanted to get it working for the two?

---

<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: [February 3, 2026, 8:21am UTC](https://discourse.paraview.org/t/extracting-section-of-grid-by-specific-values-of-field/17424/4 "2026-02-03T08:21:57Z")

</div>

With an integer, if you data is stored as a vtkIdType, you can use the select by idtype value mechanism and select multiple idtype values.

It is not available in pvpython though, yet.
