How to calculate the closest distance between a control point and a model node

hello, everyone, i have a need. how to calculate the closest distance between a control point and a model node? or here is two model node in the 3D view ,is there any good way to help me know which model did I choose with python code

When click the mouse on 3D view, the selected model will be change the color , how do i achieve that?

@lassoan , hope to get a reply