# Compute average quantities for each cross-section

**URL:** https://discourse.paraview.org/t/compute-average-quantities-for-each-cross-section/10647
**Category:** ParaView Support
**Created:** [November 1, 2022, 4:59pm UTC](https://discourse.paraview.org/t/compute-average-quantities-for-each-cross-section/10647 "2022-11-01T16:59:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Abhijeet\_Chodankar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/abhijeet_chodankar/32/4784_2.png) [@Abhijeet\_Chodankar](https://discourse.paraview.org/u/Abhijeet_Chodankar)
#### Post date: [November 1, 2022, 4:59pm UTC](https://discourse.paraview.org/t/compute-average-quantities-for-each-cross-section/10647/1 "2022-11-01T16:59:56Z")

</div>

Hello,  
I can presently compute the average quantities for each cross-section manually. It would be a tedious process to do the same for thousands of cross-sections. Is there a way to automate the process for each cross-section using python scripting or any other process?

Thank you.

Best regards,

Abhijeet C.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 1, 2022, 11:51pm UTC](https://discourse.paraview.org/t/compute-average-quantities-for-each-cross-section/10647/2 "2022-11-01T23:51:49Z")

</div>

Hi @Abhijeet_Chodankar

Definitely !

First step would be to generate a python trace (using Tools → PythonTrace) when you are using ParaView then to try to use that to automatize your workflow.

Doc: [ParaView’s Python documentation! — ParaView/Python 5.11.0-RC2-294-gb5ba73caaa documentation](https://kitware.github.io/paraview-docs/latest/python/)

Best,

---

<div class="post-metadata">

### Author: ![Abhijeet\_Chodankar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/abhijeet_chodankar/32/4784_2.png) [@Abhijeet\_Chodankar](https://discourse.paraview.org/u/Abhijeet_Chodankar)
#### Post date: [November 3, 2022, 8:21pm UTC](https://discourse.paraview.org/t/compute-average-quantities-for-each-cross-section/10647/3 "2022-11-03T20:21:52Z")

</div>

Hello @mwestphal

I am unable to track the PythonTrace command in tools options. I observe the start trace option in it. I am using Paraview 5.11.0 RC2 version. I am not a python user. I would really appreciate if you could share an example to work around this problem.

Thank you.

Best regards,

Abhijeet C.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [November 7, 2022, 7:02am UTC](https://discourse.paraview.org/t/compute-average-quantities-for-each-cross-section/10647/4 "2022-11-07T07:02:40Z")

</div>

- run ParaView
- Tools → Start trace
- Do things in GUI
- Tools → Stop trace
- File → SaveAsMacro
- Reset Session
- Press the new macro button

hth

---

<div class="post-metadata">

### Author: ![Abhijeet\_Chodankar](https://discourse.paraview.org/user_avatar/discourse.paraview.org/abhijeet_chodankar/32/4784_2.png) [@Abhijeet\_Chodankar](https://discourse.paraview.org/u/Abhijeet_Chodankar)
#### Post date: [November 7, 2022, 8:15pm UTC](https://discourse.paraview.org/t/compute-average-quantities-for-each-cross-section/10647/5 "2022-11-07T20:15:38Z")

</div>

Hello @mwestphal ,  
I followed the procedure. It worked for me.

Thank you.

Yours sincerely,

Abhijeet C.
