So far I have compiled this function based on some googling....
Seams complicated.......
Private Function GetObjectAtPoint(ByVal P As Point3d) As ObjectId
Dim vd As Vector3d = New Vector3d(0.0001, 0.0001, 0.0001)
Dim pMin As Point3d = P - vd
Dim pMax As Point3d = P + vd
Dim tvs() As TypedValue = New TypedValue() {New TypedValue(0, "LWPOLYLINE")}
Dim points As Point3dCollection = New Point3dCollection
points.Add(pMin)
points.Add(pMax)
Dim sf As SelectionFilter = New SelectionFilter(tvs)
Dim sres As PromptSelectionResult = Ed.SelectFence(points, sf)
If sres.Status <> PromptStatus.OK Then
Ed.WriteMessage("Wrong selection!")
Return ObjectId.Null
End If
If sres.Value.Count = 0 Then
Ed.WriteMessage("Nothing selected!")
Return ObjectId.Null
End If
Return sres.Value.GetObjectIds(0)
End Function