# How to get access from Programmable Filter's script to Custom Filter properties?

**URL:** https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371
**Category:** ParaView Support
**Tags:** python
**Created:** [March 1, 2019, 11:13am UTC](https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371 "2019-03-01T11:13:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Allrond](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@Allrond](https://discourse.paraview.org/u/Allrond)
#### Post date: [March 1, 2019, 11:13am UTC](https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371/1 "2019-03-01T11:13:27Z")

</div>

Hello 2 all! I try to make something like Modificated Programmable Filter by XML.  
I have made Custom Filter and export it to edit XML. I have already add the additional fields:  
NumberOfSlice and SliceMode. Question: How can i access from programmable filter script code to added properties values?  
Text of XML custom filter:  
[ProgFilt.xml](https://discourse.paraview.org/uploads/default/original/2X/a/a29cdf8066530dca9a06833e9d55803a21cce95f.xml) (3.3 KB)

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [March 1, 2019, 2:47pm UTC](https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371/2 "2019-03-01T14:47:57Z")

</div>

There’s not an easy or reliable way to do that, I’m afraid. The only way to pass properties to the **Programmable Filter** is to add to the XML properties that expose the various [`SetParameter()` member functions](https://kitware.github.io/paraview-docs/latest/cxx/classvtkPythonProgrammableFilter.html#a5acdd5ad2ebc4bc18279840d8ba3d4af) in `vtkPythonProgrammableFilter`. These are separate parameters that would be exposed in the GUI, and there isn’t a way I know of to link those properties to properties further up the pipeline such as NumberOfSlices or SliceMode.

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [March 1, 2019, 3:53pm UTC](https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371/3 "2019-03-01T15:53:10Z")

</div>

I’d recommend looking at the new Python Algorithm-based approach for creating programmable filters. An example is [here](https://gitlab.kitware.com/paraview/paraview/blob/master/Examples/Plugins/PythonAlgorithm/PythonAlgorithmExamples.py). One can literally load the python file as a plugin and the filter with appropriate GUI elements can nicely be shown.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [March 1, 2019, 4:51pm UTC](https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371/4 "2019-03-01T16:51:53Z")

</div>

Note that the approach @utkarsh.ayachit recommends, while generally superior to the **Programmable Filter** approach, still does not offer a path to accessing properties from a different filter upstream in the pipeline. The main issue is that programmable filters do not have access to information at the ParaView layer, and that is where the slice properties you seek are located.

---

<div class="post-metadata">

### Author: ![Allrond](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@Allrond](https://discourse.paraview.org/u/Allrond)
#### Post date: [March 4, 2019, 6:15am UTC](https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371/5 "2019-03-04T06:15:32Z")

</div>

Thank you for your answers. I’ll try to find something with RPC(remote procedure call) in ProgrammableFilter shell to realise this idea.

---

<div class="post-metadata">

### Author: ![Allrond](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/71e660/32.png) [@Allrond](https://discourse.paraview.org/u/Allrond)
#### Post date: [March 5, 2019, 6:32am UTC](https://discourse.paraview.org/t/how-to-get-access-from-programmable-filters-script-to-custom-filter-properties/1371/6 "2019-03-05T06:32:54Z")

</div>

Problem particulary solved by [pvpyfilter](https://github.com/shuhaowu/pvpyfilter). I make the GUI interface by generator.
