# getting at geometry point data within a python macro

**URL:** https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774
**Category:** ParaView Support
**Tags:** python
**Created:** [October 15, 2019, 5:19pm UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774 "2019-10-15T17:19:48Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![garcfd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/ccd318/32.png) [@garcfd](https://discourse.paraview.org/u/garcfd)
#### Post date: [October 15, 2019, 5:19pm UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774/1 "2019-10-15T17:19:48Z")

</div>

How do you read or modify geometry point data within a python macro?

I’m reading in an STL file with STLReader (that works ok)

Then I’m using pd = reader.GetPointDataInformation()

but its not working, and there are no error messages.

---

<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: [October 16, 2019, 4:06am UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774/2 "2019-10-16T04:06:49Z")

</div>

you should not attempt to modify geometry point data in your python macro, as the data is located on the server while your macro runs on the client.

What are you trying to achieve exactly ?

---

<div class="post-metadata">

### Author: ![garcfd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/ccd318/32.png) [@garcfd](https://discourse.paraview.org/u/garcfd)
#### Post date: [October 17, 2019, 9:47pm UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774/3 "2019-10-17T21:47:03Z")

</div>

Trying to get the STL point data, to either modify it (eg morphing) or add new geometry (eg fill holes) or maybe delete geometry… Can it be done with the macro capability or maybe there is a better approach?

---

<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: [October 18, 2019, 2:45am UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774/4 "2019-10-18T02:45:12Z")

</div>

You should use Python Programmable Filter for that:  
[https://www.paraview.org/Wiki/Python\_Programmable\_Filter](https://www.paraview.org/Wiki/Python_Programmable_Filter)

---

<div class="post-metadata">

### Author: ![garcfd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/ccd318/32.png) [@garcfd](https://discourse.paraview.org/u/garcfd)
#### Post date: [October 18, 2019, 4:01pm UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774/6 "2019-10-18T16:01:52Z")

</div>

Got it sorted eventually - thanks very much for the support !

 ![image](https://discourse.paraview.org/uploads/default/original/2X/9/9117c23267c2e18c5a413a8b7918650af6a6b24c.png)

---

<div class="post-metadata">

### Author: ![garcfd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/ccd318/32.png) [@garcfd](https://discourse.paraview.org/u/garcfd)
#### Post date: [October 19, 2019, 9:32pm UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774/7 "2019-10-19T21:32:07Z")

</div>

ended up using python macro commands such as these to achieve the task:  
data = paraview.servermanager.Fetch(reader)  
pt = data.GetPoint(j) # for point coordinates  
p1 = data.GetCell(j).GetPointId(0) # for connectivity

---

<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: [October 21, 2019, 3:50am UTC](https://discourse.paraview.org/t/getting-at-geometry-point-data-within-a-python-macro/2774/8 "2019-10-21T03:50:36Z")

</div>

Keep in mind that `Fetch` can be expansive when working remotely and that it does not allow you to modify the data and visualize it in ParaView, only to inspect the data manually.
