# Getting X coordinates alone from point through Python script

**URL:** <https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789>\
**Category:** DesignScript\
**Tags:** python\
**Created:** [May 10, 2018, 12:02pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789 "2018-05-10T12:02:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![riazconst2010](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@riazconst2010](https://forum.dynamobim.com/u/riazconst2010)\
**Post date:** [May 10, 2018, 12:02pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/1 "2018-05-10T12:02:39Z")

</div>

Hi,  
I am new to Dynamo and Python script. I am trying to get X coordinate alone from a point using Python script but it giving error as “getset\_descriptor is not callable”.

My code

import clr  
clr.AddReference(‘ProtoGeometry’)  
from Autodesk.DesignScript.Geometry import \*

# The inputs to this node will be stored as a list in the IN variables.

dataEnteringNode = IN

# Place your code below this line

# Assign your output to the OUT variable.

x=1  
y=2  
z=3

point=[]  
point.append(Point.ByCoordinates(x,y,z))

coord=Point.X(point)

OUT = coord

Please help me to solve this error.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [May 10, 2018, 12:05pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/2 "2018-05-10T12:05:52Z")

</div>

This:  
coord=Point.X(point)  
Should be:  
coord=point.X

And next time please use the ‘’\</\>’’ option when adding code for formatting reasons

---

<div class="post-metadata">

**Author:** ![riazconst2010](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@riazconst2010](https://forum.dynamobim.com/u/riazconst2010)\
**Post date:** [May 10, 2018, 12:16pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/3 "2018-05-10T12:16:30Z")

</div>

Thanks Jonathan,

I am writing the code in dynamo Python script.  
I tried changing the caps of syntax after I am getting error of “AttributeError: ‘list’ object has no attribute ‘X’”

---

<div class="post-metadata">

**Author:** ![riazconst2010](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@riazconst2010](https://forum.dynamobim.com/u/riazconst2010)\
**Post date:** [May 10, 2018, 12:17pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/4 "2018-05-10T12:17:41Z")

</div>

I am new to this forum so I cant able to upload my dynamo file.  
Any other option is there to send the dynamo file?

---

<div class="post-metadata">

**Author:** ![riazconst2010](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@riazconst2010](https://forum.dynamobim.com/u/riazconst2010)\
**Post date:** [May 10, 2018, 12:25pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/6 "2018-05-10T12:25:17Z")

</div>

Actually I got the syntax as you said.  
Same syntax I used in Python script, even though I am getting error for that syntax.

Thanks

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [May 10, 2018, 12:25pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/7 "2018-05-10T12:25:40Z")

</div>

You have to be able to distinguish between lists and what is inside lists, you’ve created a list called “point”, you append information to this list using “append”.

“point” is now a list containing exactly 1 point.

if you wish to go inside the list you can loop through it like so:

```
for pt in point:
    coord = pt.X

```

but if you are to output more than one point I’d recommend doing everything inside a loop, including appending your output to a list e.g. containing the X coordinates.

Though python is by no means necessary to export x-coordinates of points.

---

<div class="post-metadata">

**Author:** ![riazconst2010](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@riazconst2010](https://forum.dynamobim.com/u/riazconst2010)\
**Post date:** [May 10, 2018, 12:29pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/8 "2018-05-10T12:29:19Z")

</div>

Thanks Jonathan.

I am new to Dynamo and Python and in the learning stage.

This advice will solve my issue.  
Once again thanks

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [May 10, 2018, 12:31pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/9 "2018-05-10T12:31:57Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/d/9d273b704d5f4cd1266a455ea0ab698d94cb6b18.png)

I can really encourage going through the Dynamo Primer:  
[http://dynamoprimer.com/en/](http://dynamoprimer.com/en/)

And the DesignScript guide:

> **[DesignScriptGuide.pdf](https://dynamobim.org/wp-content/links/DesignScriptGuide.pdf)**
>
> 343.24 KB

Attempt to get a grasp of Dynamo before you venture into Python 🙂

And if a comment solved your issue please mark it as the solution, and maybe leave a like here and there 🙂

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [May 10, 2018, 12:37pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/10 "2018-05-10T12:37:24Z")

</div>

I’m not sure exactly what you’re after, but this might be helpful

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/d/6d655c158bb5993c88bf70fc0db0f753ad891700.png)

Also if you wish learning material for the python node have a look at this:

> **[Untangling Python: A Crash Course on Dynamo‘s Python Node](https://www.autodesk.com/autodesk-university/class/Untangling-Python-Crash-Course-Dynamos-Python-Node-2017)**
>
> This class will walk through the basic concepts involved in usingPython within the Dynamo Environment.We will cover some basic Python concepts that are needed to write a few code samples,as well as explain in detail all the boiler plate and import...

---

<div class="post-metadata">

**Author:** ![riazconst2010](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@riazconst2010](https://forum.dynamobim.com/u/riazconst2010)\
**Post date:** [May 10, 2018, 12:46pm UTC](https://forum.dynamobim.com/t/getting-x-coordinates-alone-from-point-through-python-script/21789/11 "2018-05-10T12:46:22Z")

</div>

Really this materials will help me to learn the basics.

Thanks for your guidance Jonathan.  
If any more quires I will seek help from you people.
