I want select one Polysurfase and I need the selected Point

Hello all,

I want finde the selected point to know if it´s near start or end.

I have this in Python but I want changed to c#

my Python code =>

def select():
    scriptcontext.doc.Objects.UnselectAll()
    getterc = GetObject()
    try:
        getterc.SetCommandPrompt("Please select Purlin on Start or end")
        if getterc.Get() == GetResult.Object: #we wait for the result here
            
            objref = getterc.Object(0)
            id = objref.ObjectId
            
            point = objref.SelectionPoint()
            point = rs.AddPoint(point)
    finally:
        getterc.Dispose() #this will be called in all cases 
    
    scriptcontext.doc.Objects.UnselectAll()
    return id, point

Thanks Robert