I want to have a simple function similar to autocad, which allows me to select all lines in 3D with a mouse selection.

in fig. I just want to get (x, y, z) all the selected vetices. The selection function should be like AutoCAD.
1-mouse clicks on a line
2- selection of the area With the cursor information, I get only one point (x, y, z), as shown in the figure. It would be nice if I could get all the points inside the rectangle made by the mouse (the area of interest can be a polygon).
I think the function might look like
[BW, xi, yi] = roipoly(...)
in 3D
[ xi, yi,zi] = roipoly_new(...)
source share