# VTKPythonAlgorithm XML to select a PointData array name

**URL:** https://discourse.paraview.org/t/vtkpythonalgorithm-xml-to-select-a-pointdata-array-name/12478
**Category:** ParaView Support
**Tags:** python
**Created:** [July 10, 2023, 7:43am UTC](https://discourse.paraview.org/t/vtkpythonalgorithm-xml-to-select-a-pointdata-array-name/12478 "2023-07-10T07:43:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Loic](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/e9c0ed/32.png) [@Loic](https://discourse.paraview.org/u/Loic)
#### Post date: [July 10, 2023, 7:43am UTC](https://discourse.paraview.org/t/vtkpythonalgorithm-xml-to-select-a-pointdata-array-name/12478/1 "2023-07-10T07:43:22Z")

</div>

Hi,

I’m trying to develop a plugin based on VTKPythonAlgorithmBase and I would like to let the user select the name of the PointData array to process.

I’ve found on internet that there is an ArrayListDomain XML property which gives the list of input array names. So I come with the following code:

```python
from paraview.util.vtkAlgorithm import *

@smproxy.filter()
@smproperty.input(name="Input")
@smdomain.datatype(dataTypes=["vtkDataSet"], composite_data_supported=False)
class PreserveInputTypeFilter(VTKPythonAlgorithmBase):
    """
    Example filter demonstrating how to write a filter that preserves the input
    dataset type.
    """
    def __init__ (self):
        super(). __init__ (nInputPorts=1, nOutputPorts=1, outputType="vtkDataSet")
        self._array_name = ''

    @smproperty.stringvector(name="Array", label="Array", number_of_elements="5", default="0", element_types="0 0 0 0 2", animateable="0")
    @smdomain.xml("""
       <ArrayListDomain name="array_list" attribute_type="Scalars" input_domain_name="inputs_array">
         <RequiredProperties>
           <Property name="Input" function="Input"/>
         </RequiredProperties>
       </ArrayListDomain>
    """)
    def SetArray(self, *args):
        print("choosing array", args)
        self._array_name = args

    def RequestDataObject(self, request, inInfo, outInfo):
        inData = self.GetInputData(inInfo, 0, 0)
        outData = self.GetOutputData(outInfo, 0)
        assert inData is not None
        if outData is None or (not outData.IsA(inData.GetClassName())):
            outData = inData.NewInstance()
            outInfo.GetInformationObject(0).Set(outData.DATA_OBJECT(), outData)
        return super().RequestDataObject(request, inInfo, outInfo)

    def RequestData(self, request, inInfo, outInfo):
        inData = self.GetInputData(inInfo, 0, 0)
        outData = self.GetOutputData(outInfo, 0)
        print("input type =", inData.GetClassName())
        print("array :", self._array_name)
        print("output type =", outData.GetClassName())
        assert outData.IsA(inData.GetClassName())
        return 1

```

I’ve seen in [ArrayListDomain’s documentation](https://kitware.github.io/paraview-docs/latest/cxx/classvtkSMArrayListDomain.html#details) that it should be possible to filter the kind of array:

- either with the “FieldDataSelection” function
- or with the “input\_domain\_name” attribute.

But I could’nt get this to work.

Does anyone have an idea on how to filter this list and display only array names associated with point data ?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Kenichiro-Yoshimi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/k/ecc23a/32.png) [@Kenichiro-Yoshimi](https://discourse.paraview.org/u/Kenichiro-Yoshimi)
#### Post date: [July 12, 2023, 2:20am UTC](https://discourse.paraview.org/t/vtkpythonalgorithm-xml-to-select-a-pointdata-array-name/12478/2 "2023-07-12T02:20:35Z")

</div>

If you want the user to select only the array name of the `PointData`, it seems to be possible by `attribute_type` in `InputArrayDomain`.

```xml
@smproxy.filter()
@smproperty.input(name="Input")
@smdomain.datatype(dataTypes=["vtkDataSet"], composite_data_supported=False)
@smdomain.xml(
  '''
  <InputArrayDomain name="inputs_array" attribute_type="point" />'''
)
class PreserveInputTypeFilter(VTKPythonAlgorithmBase):

```
