# PointCoordinate Text Field

**URL:** <https://discourse.mcneel.com/t/pointcoordinate-text-field/196942>\
**Category:** Rhino Developer\
**Tags:** windows, python\
**Created:** [December 23, 2024, 8:56pm UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942 "2024-12-23T20:56:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RogerD](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rogerd/32/687800_2.png) [@RogerD](https://discourse.mcneel.com/u/RogerD)\
**Post date:** [December 23, 2024, 8:56pm UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942/1 "2024-12-23T20:56:56Z")

</div>

Hi,

Can anyone please help me with trying to get point coordinates using TextField in python 3.0  
I know there are other ways to get this information but I need it to be a TextField . I have done curve length using similar syntax but cannot get PointCordinate to work.  
Also not sure how to define the “Axes” to be output.  
The font info comes from an eto form and that is ok.

Maybe its a bug not sure.

All the best

Roger

```auto
    if objs:
        for obj in objs:

            crvstart = rs.CurveStartPoint(obj)
            stpt = rs.AddPoint(crvstart)
            
            #print(stpt)#ignore these lines 
            #print(crvstart)
            #csx = crvstart[0]
            #csy = crvstart[1]
            #csz = crvstart[2]

            crvend = rs.CurveEndPoint(obj)

            #%<PointCoordinate("ObjectID","Axes")>% #### this is the format given in rhino help file
            stco = "%<PointCoordinate ('" + str(stpt) + "')>%"
            
            print(stco)

            text3D = rs.AddText(str(stco), crvstart, height=Font, font="Arial", font_style=1, justification=2)
  

    print ("End of Print Curve XYZ")

```

---

<div class="post-metadata">

**Author:** ![Measure](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/measure/32/651816_2.png) [@Measure](https://discourse.mcneel.com/u/Measure)\
**Post date:** [December 23, 2024, 9:40pm UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942/2 "2024-12-23T21:40:36Z")

</div>

Have you tried using something like “XY” or “XYZ” for the axis parameter?

---

<div class="post-metadata">

**Author:** ![RogerD](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rogerd/32/687800_2.png) [@RogerD](https://discourse.mcneel.com/u/RogerD)\
**Post date:** [December 23, 2024, 9:46pm UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942/3 "2024-12-23T21:46:19Z")

</div>

Hi yes I have , not sure why it doesn’t work, used it in rvb scripts before but never in Python 3 so maybe I am not going about it correctly.

Roger

---

<div class="post-metadata">

**Author:** ![Measure](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/measure/32/651816_2.png) [@Measure](https://discourse.mcneel.com/u/Measure)\
**Post date:** [December 23, 2024, 9:48pm UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942/4 "2024-12-23T21:48:53Z")

</div>

Something like this?

```auto
guid = str(stpt)
axes = "XYZ"
stco = '%<PointCoordinate("{}","{}")>%'.format(guid, axes)

```

It looks like you have a space here `PointCoordinate (` that could be causing a problem?

---

<div class="post-metadata">

**Author:** ![RogerD](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rogerd/32/687800_2.png) [@RogerD](https://discourse.mcneel.com/u/RogerD)\
**Post date:** [December 23, 2024, 10:15pm UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942/5 "2024-12-23T22:15:50Z")

</div>

Hi,

I have tried so many combinations that I have lost count , I am aware of the space but I will try your format in the morning.

Many thanks and Merry Christmas

---

<div class="post-metadata">

**Author:** ![RogerD](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/rogerd/32/687800_2.png) [@RogerD](https://discourse.mcneel.com/u/RogerD)\
**Post date:** [December 24, 2024, 8:18pm UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942/6 "2024-12-24T20:18:08Z")

</div>

> [@Measure](#):
>
> ```auto
> guid = str(stpt)
> axes = "XYZ"
> stco = '%<PointCoordinate("{}","{}")>%'.format(guid, axes)
> 
> ```

Hi Measure,

I can confirm that your code does work and I am now able to continue with the rest of my script.

I hope the folks at McNeels can update the info for Text Fields especially when being used in Python as the example in the help files didn’t work.  
Merry Christmas and a Happy New Year

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/498369_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [December 25, 2024, 10:12am UTC](https://discourse.mcneel.com/t/pointcoordinate-text-field/196942/7 "2024-12-25T10:12:41Z")

</div>

> [@RogerD](#):
>
> I hope the folks at McNeels can update the info for Text Fields especially when being used in Python as the example in the help files didn’t work.

If you think something there might be a bug or a mistake somewhere, please provide a link so the developers know where to start.
