# VtkPythonAlgorithm with adaptable outputType

**URL:** https://discourse.paraview.org/t/vtkpythonalgorithm-with-adaptable-outputtype/4546
**Category:** Development
**Created:** [June 9, 2020, 10:01am UTC](https://discourse.paraview.org/t/vtkpythonalgorithm-with-adaptable-outputtype/4546 "2020-06-09T10:01:57Z")
**Posts on this page:** 1
**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: [June 9, 2020, 10:01am UTC](https://discourse.paraview.org/t/vtkpythonalgorithm-with-adaptable-outputtype/4546/1 "2020-06-09T10:01:57Z")

</div>

I would like to develop a filter that could works with either vtkUnstructuredGrid or vtkPolyData objects:

- if the input object is a vtkUnstructuredGrid, it should return a vtkUnstructuredGrid object
- if the input object is a vtkPolyData, it should return a vtkPolyData object

Is it possible to define such filter with a vtkPythonAlgorythm subclass?

Have you got any example showing how to setup the vtkPythonAlgorithm outputType on the fly, according to input data information?

Best Regards,

Loïc
