# Get points Z coordinate from Python

**URL:** <https://forum.dynamobim.com/t/get-points-z-coordinate-from-python/39887>\
**Category:** Uncategorized\
**Created:** [August 26, 2019, 12:47pm UTC](https://forum.dynamobim.com/t/get-points-z-coordinate-from-python/39887 "2019-08-26T12:47:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jessedellemannKNYBE](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jessedellemannKNYBE](https://forum.dynamobim.com/u/jessedellemannKNYBE)\
**Post date:** [August 26, 2019, 12:47pm UTC](https://forum.dynamobim.com/t/get-points-z-coordinate-from-python/39887/1 "2019-08-26T12:47:35Z")

</div>

Hello, can anyone help me to solve this code?

I want to get the X coordinate of the points with some Python code but I get lost.  
Python gives an error, and I don’t know how to solve it.

 ![Question](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/b/8b8b79230c248f1b950d12155c83ba09c1b58184.png)

Thanks in advance 😉

---

<div class="post-metadata">

**Author:** ![Thomas\_Corrie](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/thomas_corrie/32/63060_2.png) [@Thomas\_Corrie](https://forum.dynamobim.com/u/Thomas_Corrie)\
**Post date:** [August 26, 2019, 1:01pm UTC](https://forum.dynamobim.com/t/get-points-z-coordinate-from-python/39887/2 "2019-08-26T13:01:54Z")

</div>

The error is because you are asking a list for its Z coordinate, rather than an individual point. One method is to loop over the list of points and query their individual Z positions and appending that to the out list:

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

points = IN[0]

out = []
for point in points:
	out.append(point.Z)

OUT = out

```

or, in one line

`OUT = [point.Z for point in IN[0]]`

---

<div class="post-metadata">

**Author:** ![jessedellemannKNYBE](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jessedellemannKNYBE](https://forum.dynamobim.com/u/jessedellemannKNYBE)\
**Post date:** [August 26, 2019, 2:02pm UTC](https://forum.dynamobim.com/t/get-points-z-coordinate-from-python/39887/3 "2019-08-26T14:02:02Z")

</div>

Thank you very much!
