programmable source for arrow

Hi all! I am learning now about the use of programmable sources and programmable filters. Most examples that I found deal with manipulating point data and constructing objects from that.

But how can I use a programmable source to visualize an arrow (or any of the options in the ‘Sources’)? [edit: I do not necessarily mean that I want to use ArrowSource, I want to reproduce what it does]. I couldn’t figure out how to get from the information in the python trace to a programmable source.
I see in the python trace:
arrow2 = vtkArrowSource()
and in the programmable source I could add

from vtkmodules.vtkFiltersSources import vtkArrowSource
arrow2 = vtkArrowSource()

and I see that I get an object of class:

<class 'vtkmodules.vtkFiltersSources.vtkArrowSource'>

I guess the object is created but I have to couple it to the output but I do not know how.
[edit2: I also see that I can use arrow=simple.Arrow() in a programmable source, so I guess I’m asking if 1. it is possible to work with arrowSource, and 2. if it provides any benefits over working directly with the paraview object]

For example, if you write the following in the Script of Programmable Source, it seems to work well.

from vtkmodules.vtkFiltersSources import vtkArrowSource

arrow2 = vtkArrowSource()


Thank you! I am confused though. Why do I need to put the arrow2 into output, but I don’t need to do this for a vtk.simple.Arrow()? Or am I doing it wrong and should a result of a programmable source always be put into an output?

The output is the interface for registering to the ParaView pipeline, so the results of the Programmable Source must be put in the output.

The paraview.simple Python module is used to script actions to be performed using the Paraview UI, and is executed on the client side. On the other hand, programmable modules are executed on the server side, and these are completely different. Hence, calling the paraview.simple Python module in the Programmable Source is not supported and will lead to unexpected results.

For more detailed information, please refer to the following page.