Get name textdot python rhino6

i want get name off textdot and compare them but i can’t in python. Please help me get them

What have you tried?

_dot=rs.GetObject(“get text dot”)
_dot2=rs.GetObject(“get text dot 2”)
if(_dot==_dot2):
print(“true”)
else:
print(“false”)
print (_dot)
print (_dot2)

Result
false
10f7e900-90f8-40c5-8bd8-3355af02f87d
c2c7728e-cc66-48aa-a3bc-6b6730325fef

EX:
Textdot is 2
I want get text “2” off textdot and compare.
i can’t find gettext off textdot in python for rhinoceros

To get the text from a text dot, you need to use rs.TextDotText… check the Help for more details.

Here is a small sample:

import rhinoscriptsyntax as rs

dots=rs.GetObjects("Select 2 text dots to compare",8192,minimum_count=2,maximum_count=2)
if dots:
    #get texts from the dots into a list
    texts=[rs.TextDotText(dot) for dot in dots]
    #strict comparison - case sensitive
    if texts[0]==texts[1]: print "Dot texts match exactly"
    
    #textual comparison - not case sensitive
    if texts[0].lower()==texts[1].lower(): print "Dot text spellings match"

It true.
Thank a lot!