Get edges connected to a solid control point

Hi all. this might be a newb question (i have searched though) but i need a way to get the a list of edges that are connected to a solid control point.
To illustrate my point, if i have a cube, and i select one of the corners, i need to a way to return the three incident edges to that corner.

It doesn’t matter which language/api, but i’d prefer a finding a solution via scripting (python, rhinoscript) rather than plug-in (c++, c#), unless absolutely necessary

Thanks in advance!

here’s what i found in python, for reference:

import rhinoscriptsyntax as rs

brep_id = rs.GetObject("pick a polysurface", rs.filter.polysurface)
brep = rs.coercebrep(brep_id)
edges = brep.Edges

rs.SelectObject(brep_id)
rs.Command("_SolidPtOn")
grip = rs.GetObjectGrip("Select control point grip")

c_edges = []

for e in edges:
    if grip[2] == e.StartVertex.Location or \
    grip[2] == e.EndVertex.Location:
        c_edges.append(e)