# How to update values in python paraview?

**URL:** https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251
**Category:** Development
**Created:** [August 19, 2024, 12:04pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251 "2024-08-19T12:04:39Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 12:04pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/1 "2024-08-19T12:04:39Z")

</div>

Hello dear ParaView developers!

I have a filter, and I call from python some functions for it (via command in xml)

Some of filter’s fields are modified

How can I update the value of filter’s field on the client then ?

Thank you very much

---

<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: [August 19, 2024, 12:11pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/2 "2024-08-19T12:11:42Z")

</div>

I’m not enterely sure to follow your question.

In ParaView, properties are going from the client to the server. Information properties are going from the server to the client. There is not biderectional properties.

If you want to have a client side Qt widget that show multiple property (eg, a standard and a information) than you have to implement it yourself and use panel\_widget on a property group.

I hope that answers your question.

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 12:24pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/3 "2024-08-19T12:24:45Z")

</div>

But what if function is triggered from the client, e.g. some member function of the filter gets executed, and modifies some fields of the class, which are also properties?

The values of variables, to which some properties correspond, are modified.  
How to make the property return have the same value as the variable already has on the server?

---

<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: [August 19, 2024, 12:26pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/4 "2024-08-19T12:26:05Z")

</div>

I’m afraid I dont follow your question. Could you share an simple XML to illustrate what you want to do ?

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 12:30pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/5 "2024-08-19T12:30:28Z")

</div>

I have

```auto
		<IntVectorProperty
		   name="X"
		   command="SetX"
		   number_of_elements="1"
		   default_values="0"
		   label="X"
		   panel_visibility="never">
			<Documentation>
				Set X, and trigger Y modification
			</Documentation>
		</IntVectorProperty>

```

I use it from python:

```auto
filter.X = 5 (Python)

```

And SetX function of my plugin also triggers some code, lets’s say

```auto
this->Y = 100; (C++, triggered by Python)

```

How can I then get Y from python?

```auto
filter.Y does not work, it has the old meaning, does not equal to the Y on the server

```

---

<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: [August 19, 2024, 12:34pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/6 "2024-08-19T12:34:13Z")

</div>

> [@joint](#):
>
> How can I then get Y from python?

Y does not exist from pvpython point of view. you could declare it as a information property in the XML though.

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 12:36pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/7 "2024-08-19T12:36:02Z")

</div>

It exists

```auto
<IntVectorProperty
		   name="Y"
		   command="SetY"
		   number_of_elements="1"
		   default_values="0"
		   label="Y"
		   panel_visibility="never">
			<Documentation>
				SetY
			</Documentation>
		</IntVectorProperty>

```

But it does not get modified after that what I have described

---

<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: [August 19, 2024, 12:38pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/8 "2024-08-19T12:38:07Z")

</div>

Indeed, because it is not an information property. property are either standard (client to server) or information (server to client), not bidirectional.

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 12:42pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/9 "2024-08-19T12:42:55Z")

</div>

Dear Mathieu, could you give an example how to make this integer property informational one?

---

<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: [August 19, 2024, 12:44pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/10 "2024-08-19T12:44:25Z")

</div>

[https://gitlab.kitware.com/paraview/paraview/-/blob/master/Examples/Plugins/RegistrationName/Plugin/RegistrationName.xml?ref\_type=heads#L31](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Examples/Plugins/RegistrationName/Plugin/RegistrationName.xml?ref_type=heads#L31)

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 12:56pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/11 "2024-08-19T12:56:51Z")

</div>

Sadly enough, I dont see this property via python

```auto
		<!-- ParaView Mathieu, obtain value from the server -->
		<DoubleVectorProperty
			label="Gettest"
			name="Gettest"
			number_of_elements="1"
			default_values="0"
			command="Gettest"
			panel_visibility="never"
			information_only="1">

		</DoubleVectorProperty>

```

---

<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: [August 19, 2024, 12:58pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/12 "2024-08-19T12:58:00Z")

</div>

What do you mean ? What kind of error do you have ?

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 1:05pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/13 "2024-08-19T13:05:01Z")

</div>

O, I get it, it is available as filter.test, not as filter.Gettest

Thank you very much!

---

<div class="post-metadata">

### Author: ![joint](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joint](https://discourse.paraview.org/u/joint)
#### Post date: [August 19, 2024, 2:05pm UTC](https://discourse.paraview.org/t/how-to-update-values-in-python-paraview/15251/14 "2024-08-19T14:05:24Z")

</div>

Mathieu, I still have problems

```auto
		<!-- Python fpr test -->
		<IntVectorProperty
		   name="Settest"
		   command="Settest"
		   number_of_elements="1"
		   default_values="0"
		   label="Settest"
		   panel_visibility="never">
			<Documentation>
				Python function for test obtaining.
			</Documentation>
		</IntVectorProperty>

		<!-- ParaView Mathieu, obtain value from the server -->
		<DoubleVectorProperty
			label="Gettest"
			name="Gettest"
			number_of_elements="1"
			default_values="0"
			command="Gettest"
			panel_visibility="never"
			information_only="1">

		</DoubleVectorProperty>

```

However when I do dir(filter) only Settesest is presented, and Gettest is missing, why so?
