# Python - Get Coordinate from point

**URL:** <https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685>\
**Category:** Developers\
**Tags:** python\
**Created:** [February 2, 2023, 5:29pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685 "2023-02-02T17:29:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![aafonsoBYKA8](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aafonsobyka8/32/134436_2.png) [@aafonsoBYKA8](https://forum.dynamobim.com/u/aafonsoBYKA8)\
**Post date:** [February 2, 2023, 5:29pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/1 "2023-02-02T17:29:02Z")

</div>

Hi,

I need to get the coordinate of a point.

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

The result I get with my script is:

\<Autodesk.DesignScript.Geometry.Point object at 0x0000000000004B23 [Point(X = -11.987, Y = 15.666, Z = 10.000)]\>]

But I need:

(X = -11.987, Y = 15.666, Z = 10.000)

How can I get this?

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [February 2, 2023, 5:30pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/2 "2023-02-02T17:30:24Z")

</div>

Can you show us how you’re getting this output? It looks more like a string than an object.

---

<div class="post-metadata">

**Author:** ![aafonsoBYKA8](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aafonsobyka8/32/134436_2.png) [@aafonsoBYKA8](https://forum.dynamobim.com/u/aafonsoBYKA8)\
**Post date:** [February 2, 2023, 5:32pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/3 "2023-02-02T17:32:46Z")

</div>

```auto
for room in rooms:
    #t.Start()
    room_loc = room.Location.Point
    boundaries = room.GetBoundarySegments(SBO)
    segGroup = []
    for bound in boundaries:
        pGroup=[]
        cLoops=[]
        for seg in bound:
            pGroup.append(seg.GetCurve().GetEndPoint(0).ToPoint())
   print(pGroup)

```

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [February 2, 2023, 5:48pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/4 "2023-02-02T17:48:09Z")

</div>

Ah. Looks like you’re using `print` instead of `OUT`. Print will log the output to the console. OUT will return the objects at the python node.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/1/e148cc3e865556fb5bf1e40e2f0cc088c086818e.png)

---

<div class="post-metadata">

**Author:** ![aafonsoBYKA8](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aafonsobyka8/32/134436_2.png) [@aafonsoBYKA8](https://forum.dynamobim.com/u/aafonsoBYKA8)\
**Post date:** [February 2, 2023, 6:31pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/5 "2023-02-02T18:31:03Z")

</div>

I am not using dynamo actually. I am running directly with python. Maybe that´s the problem.

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [February 2, 2023, 6:42pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/6 "2023-02-02T18:42:10Z")

</div>

Hmm. It’s still weird that it returns a description of the object.  
Try printing the points individually instead of as a list.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/8/785e43d4a75c85c465e319901d4f0b29e85b0f26.png)

---

<div class="post-metadata">

**Author:** ![aafonsoBYKA8](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aafonsobyka8/32/134436_2.png) [@aafonsoBYKA8](https://forum.dynamobim.com/u/aafonsoBYKA8)\
**Post date:** [February 2, 2023, 6:54pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/7 "2023-02-02T18:54:14Z")

</div>

I did that but the ouput is:  
Point(X = -11.987, Y = 17.666, Z = 2.500)

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/e/4e97f6fbdfc332f091906f590c483f01b9dbf531.png)

I need:  
(-11.987, 17.666, 2.500)

```auto

for room in rooms:
    #t.Start()
    room_loc = room.Location.Point
    boundaries = room.GetBoundarySegments(SBO)
    segGroup = []
    print(room_loc)
    for bound in boundaries:
        pGroup=[]
        cLoops=[]
        for seg in bound:
            pGroup.append(seg.GetCurve().GetEndPoint(0).ToPoint())
            for p in pGroup:
                print(p)

```

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [February 2, 2023, 7:00pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/8 "2023-02-02T19:00:13Z")

</div>

You should just need to convert them to Revit XYZs.

---

<div class="post-metadata">

**Author:** ![aafonsoBYKA8](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aafonsobyka8/32/134436_2.png) [@aafonsoBYKA8](https://forum.dynamobim.com/u/aafonsoBYKA8)\
**Post date:** [February 2, 2023, 7:00pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/9 "2023-02-02T19:00:58Z")

</div>

I got it.

I need to append:

```auto
 pGroup.append(seg.GetCurve().GetEndPoint(0))

```

and not

```auto
 pGroup.append(seg.GetCurve().GetEndPoint(0).ToPoint())

```

```auto
for room in rooms:
    #t.Start()
    room_loc = room.Location.Point
    boundaries = room.GetBoundarySegments(SBO)
    segGroup = []
    print(room_loc)
    for bound in boundaries:
        pGroup=[]
        cLoops=[]
        for seg in bound:
            pGroup.append(seg.GetCurve().GetEndPoint(0))
            for p in pGroup:
                print(p)

```

This way I get: (-11.987, 17.666, 2.500)

Makes sense, obviously. 😮

Thanks for your help Nick 🙂

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [February 2, 2023, 7:01pm UTC](https://forum.dynamobim.com/t/python-get-coordinate-from-point/85685/10 "2023-02-02T19:01:35Z")

</div>

Hello,  
Out of curiosity you can reveal your beginning of code  
it appears to be a memory stored object returned every time with the class  
(I’m not strong, the terms are not necessarily the right ones)

cordially  
christian.stan
