# Set property server side to retrieve from client using vtkSMPropertyHelper

**URL:** https://discourse.paraview.org/t/set-property-server-side-to-retrieve-from-client-using-vtksmpropertyhelper/11794
**Category:** ParaView Support
**Created:** [April 3, 2023, 11:51am UTC](https://discourse.paraview.org/t/set-property-server-side-to-retrieve-from-client-using-vtksmpropertyhelper/11794 "2023-04-03T11:51:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Pietersielie](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/ba8739/32.png) [@Pietersielie](https://discourse.paraview.org/u/Pietersielie)
#### Post date: [April 3, 2023, 11:51am UTC](https://discourse.paraview.org/t/set-property-server-side-to-retrieve-from-client-using-vtksmpropertyhelper/11794/1 "2023-04-03T11:51:17Z")

</div>

Apologies if this is the wrong place to ask, I didn’t find a solution to my problem in other sources. I’m not very experienced with Paraview, but more so with VTK. I’m using Paraview 5.11, built from source, on Arch Linux.

I have an issue where my `pvserver` (with a custom plugin) has a source with a proxy property that can be set either algorithmically by the server, or manually by the user from the client.

The xml for the plugin contains the following, by analogy from [here](https://gitlab.kitware.com/paraview/paraview/-/blob/master/Remoting/Application/Resources/proxies_gdal.xml):

```auto
  <IntVectorProperty
    command="GetScaleFactor"
    information_only="1"
    name="ScaleFactorInfo">
  </IntVectorProperty>

  <IntVectorProperty
    command="SetScaleFactor"
    default_values="1"
    information_property="ScaleFactorInfo"
    name="ScaleFactor"
    number_of_elements="1">
    <Documentation>
      This property can be used to read only every inc-th pixel along the dimensions of the image.
    </Documentation>
  </IntVectorProperty>

```

This works perfectly fine if the client side is setting the value, e.g.:

```auto
...
//Set ScaleFactor using the user's choice if not autoscaled
if (!useAutoScale)
    vtkSMPropertyHelper(src->getProxy(), "ScaleFactor").Set(client_choice_num);
...
//time passes
...
//Retrieve ScaleFactor
int scaleFac;
vtkSMPropertyHelper(src->getProxy(), "ScaleFactor").Get(&scaleFac);
//use the retrieved ScaleFactor on the client side

```

However, when this property is set algorithmically by the server, the reading step does not work. E.g., on the custom plugin side, with the header and class as follows:

```auto
//myCustomReader.h

class VTK_EXPORT myCustomReader : public vtkMPIImageReader
{
  public:
    ...
    vtkGetMacro(ScaleFactor, int);
    vtkSetMacro(ScaleFactor, int);
    ...
  protected:
    ...
  private:
    ...
    /**
     * @brief This property can be used to read only every inc-th pixel along the
     * dimensions of the image.
     *
     */
    int ScaleFactor;
};

//myCustomReader.cxx
    ...
    //if the image should be scaled automatically
    if (AutoScale){
        int sf = calcScaleFactor(size, limit);
        this->SetScaleFactor(sf);
    }
    ...
    vtkDebugMacro(<< "Scale factor: " << this->GetScaleFactor())
    ...

```

The server’s debug output gives me the correct and expected value of `sf`, and the rendering behaviour is as expected. However, the value retrieved using the `vtkSMPropertyHelper` does not match and is only the default 1. Again, it works perfectly if it is first set from the client side and then retrieved.

I would like to know why setting the property value on the server side does not allow for retrieval by the client, and if there is a way to do it without moving the calculation to the client side.

Thank you in advance.
