The mouse position is obtained as follows.
msg[c4d.BFM_INPUT_X] --> GetEditorWindow() --> editor_x = win.Global2Local() --> mouse_x-abs(Editor_x)
The problem of overlapping selection in GetNearestPoint() was solved by making a list of selected object.
Thank you.