# Generating CSV or a Matrix in custom application code

**URL:** https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874
**Category:** Development
**Created:** [April 13, 2023, 6:39pm UTC](https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874 "2023-04-13T18:39:46Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 13, 2023, 6:39pm UTC](https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874/1 "2023-04-13T18:39:46Z")

</div>

Hi, In my custom application I want to convert my object into a csv or a matrix form. I mean in the code I want to generate the CSV and pass it to my own backend simulation code. How can I achieve that?  
It can have multiple filters, including 3-4 calculator filter which generate new arrays. I want all these new arrays to be in the final csv.  
How can I achieve this goal?

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [April 14, 2023, 9:15pm UTC](https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874/2 "2023-04-14T21:15:06Z")

</div>

[Programmable](https://docs.paraview.org/en/latest/ReferenceManual/pythonProgrammableFilter.html) filter + numpy should be a way to do this. You can even write a proper writer , check the last example in the link that offers a numpy writer.

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 14, 2023, 9:18pm UTC](https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874/3 "2023-04-14T21:18:53Z")

</div>

Would I be able to do this in my custom application which I am writing in C++ and Qt, similar to Clone 1 example given on the github?  
[ParaView/Examples/CustomApplications/Clone1 at master · Kitware/ParaView · GitHub](https://github.com/Kitware/ParaView/tree/master/Examples/CustomApplications/Clone1)

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [April 14, 2023, 9:22pm UTC](https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874/4 "2023-04-14T21:22:58Z")

</div>

I haven’t used it demo recently but I see that the programmable filter is included

> <https://github.com/Kitware/ParaView/blob/master/Examples/CustomApplications/Clone1/ParaViewFilters.xml#L34>

so you could give it a try.

---

<div class="post-metadata">

### Author: ![Muhammad\_Saad\_Atique](https://discourse.paraview.org/user_avatar/discourse.paraview.org/muhammad_saad_atique/32/11159_2.png) [@Muhammad\_Saad\_Atique](https://discourse.paraview.org/u/Muhammad_Saad_Atique)
#### Post date: [April 14, 2023, 9:28pm UTC](https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874/5 "2023-04-14T21:28:55Z")

</div>

I am trying to do something different, let me explain more clearly.

So I have this custom application of paraview, goal is to do my analysis (add filters etc), then I want to run my own simulation (a different code that I have in C++). I want to pass my object which I have created (using filters and other details) to my simulation code. I want to pass my object as a csv to my backend simulation code.

So, what I am asking is that, is there a way to convert my object into csv in a C++ code not from the gui itself?

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [October 5, 2023, 9:29pm UTC](https://discourse.paraview.org/t/generating-csv-or-a-matrix-in-custom-application-code/11874/6 "2023-10-05T21:29:44Z")

</div>

> I want to pass my object which I have created (using filters and other details) to my simulation code. I want to pass my object as a csv to my backend simulation code.

I am not aware of such mechanism in either VTK or ParaView. However, you may want to look into [state files](https://docs.paraview.org/en/v5.8/UsersGuide/savingResults.html#saving-state) of ParaView they are similar to xml files and they describe how different filters are connected together.
