# programmable source for arrow

**URL:** https://discourse.paraview.org/t/programmable-source-for-arrow/8961
**Category:** ParaView Support
**Created:** [February 12, 2022, 9:13am UTC](https://discourse.paraview.org/t/programmable-source-for-arrow/8961 "2022-02-12T09:13:15Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![bigfooted](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bigfooted/32/6347_2.png) [@bigfooted](https://discourse.paraview.org/u/bigfooted)
#### Post date: [February 12, 2022, 9:13am UTC](https://discourse.paraview.org/t/programmable-source-for-arrow/8961/1 "2022-02-12T09:13:15Z")

</div>

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

```auto
from vtkmodules.vtkFiltersSources import vtkArrowSource
arrow2 = vtkArrowSource()

```

and I see that I get an object of class:

```auto
print(type(arrow2))
<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]

---

<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: [February 13, 2022, 5:43am UTC](https://discourse.paraview.org/t/programmable-source-for-arrow/8961/2 "2022-02-13T05:43:40Z")

</div>

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

```python
from vtkmodules.vtkFiltersSources import vtkArrowSource

arrow2 = vtkArrowSource()
arrow2.Update()

output.DeepCopy(arrow2.GetOutput())

```

---

<div class="post-metadata">

### Author: ![bigfooted](https://discourse.paraview.org/user_avatar/discourse.paraview.org/bigfooted/32/6347_2.png) [@bigfooted](https://discourse.paraview.org/u/bigfooted)
#### Post date: [February 13, 2022, 10:15am UTC](https://discourse.paraview.org/t/programmable-source-for-arrow/8961/3 "2022-02-13T10:15:45Z")

</div>

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?

---

<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: [February 13, 2022, 12:13pm UTC](https://discourse.paraview.org/t/programmable-source-for-arrow/8961/4 "2022-02-13T12:13:41Z")

</div>

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.  
[https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html)
