I am indeed working on a similar problem but Iv’e already past the “picking on or near” problem. I use PickHelper.boundingbox_pick. It’s seem to be the only way to pick without screen coordinates. You just have to define “near” by the size of the box.
A custom tool can handle the “onLButtonDown” as follows:
def onLButtonDown(flags, x, y, view)
pickhelper = view.pick_helper(x,y)
count = pickhelper.do_pick(x, y)
best_picked = pickhelper.best_picked
@entity_path_list = pickhelper.path_at(0)
The X and Y coordinates are given to the pick helper method to analyze what was clicked. If an ungrouped edge was clicked, then you could obtain 3D coordinates of the edge with vertices from “best_picked”.
If the edge is buried in a series of nested grouped objects, then “@entity_path_list” will contain an array of drawing elements containing the path to the edge. The edge’s vertex positions are in local coordinates and you have to apply the transformations of all the grouped objects to obtain the positions in world coordinates.