Method to select an object and any others that touch it....?

I thought I used to be able to do this with stock Rhino but I can’t figure it out now…? May be it was a script I had at one time.

Brian

Maybe you can try a logic similar as this post : Remove duplicate geometries

this script find nearest elements and group them (and finally select only 1 elements from each group).

Default is set to 10 units, you can change it to the proximity you want.

That might work if I knew anything about Grasshopper.

Brian

Bringing this topic back up…I really need to find a way to get this to work.

Ideally I would like to be able to set a tolerance and then select a polysurface/extrusion and have it automatically select any other polysurfaces/extrusions that fall within those bounds.

If this is something that will take quite a lot of scripting I am willing to pay.

I have attached a small portion of a limestone/precast project I am working on. I need to be able to select one of the concrete/precast polysurfaces and have the script select all the limestone that will be attached to it.

The concrete/precast is on layer precast.

Thanks in advance…
Brian

PS…Attached file is in R6 format, I can post an R5 if needed.limestone-precast-selection-script.3dm (19.8 MB)

Hm… it should be relatively easy with boxy things like this - presumably you want to be able to set a radius or tolerance, right?
@bwheeler - here is a quick and dirty python that may do the job - see how that works.
SelNearby.py (972 Bytes)

Use
! -RunPythonScript "Full path to py file inside double quotes"

Hm - not too reliable yet… hold on a sec

@bwheeler - here’s another - it should be less sensitive to blockiness and orientation.

SelNearby_04_05_18.py (1.3 KB)

-Pascal

Yes…All the precast to precast joints on this project are 5/8", the limestone to limestone joints are 1/4". So lets say I set the tolerance to 1/8" that would pick up all the limestone that touched or was no more than 1/8" away from the selected precast panel.

My company did the limestone model and another company is doing the precast. I have imported their 3d precast model into Rhino and need an easy way to view all the limestone that will be attached to each of their precast panels.

See screen shot for an example…

Brian

Thank you for the help Pascal…I’m leaving the office now, but will check back in over the weekend.

Brian

OK - I changed out the script above - if anything it will probably over-select sometimes but on orthogonally arranged blocky things it may be ok. I’ll monkey with getting something better.

-Pascal

Works like a charm…Let me know the next time the kids are doing some kind of fundraiser, I’m good for a couple boxes of cookies or whatever. I can’t think you enough. I’ll be sure to brag on McNeel/Rhino when I show this off during the next GoToMeeting we have every Tuesday.

Thank You again…
Brian

Pascal, is there any way to modify the script so I can use line in 3d space to select other nearby lines in 3d space?
I have specific situation that I work with cloud of points that is converted in cloud of small circles/lines and now I want to be able to draw the selection line over that cloud to select only circles that are nearby that selection line - I would like to be able to control the “nearby” distance so I can choose how far from the line I want circles to be selected.

Hi Pascal,
How do I run this script? I would like to do the same thing… select all polylines touching another polyline

Thank you!

Hi Melissa - this script will not work on anything but surfaces and polysurfaces. I could add meshes, but polylines or curves will not work. Can you post an example file?

-Pascal

I want to select all the polylines that run off of a main one (in this case a river, to select all the tributaries but not the lakes etc that aren’t linked to the river)

Hello- can you please post a Rhino file? Just enough for me to see a couple of cases of what you are dealing with exactly, I don’t need the whole thing.

-Pascal

St Lawrence River Basin.3dm (11.6 MB) Hi - let me know if this works, thank you!

Does this script help?
SelCrvsIntersectingWCrv.py (1.1 KB)

=) You’re not supposed to wait until I’ve almost finished typing to post these. Just sayin’.

Here’s my go at it…

SelTouchingCurves.py (1.1 KB)

@melissawall63, for these scripts:

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal

Sorry… :innocent:

Those are both brilliant thank you so much!
Do you know if there is a trick for having multiple curves as the base curve? or alternatively a group? I can’t seem to join the curves because they are closed. What I am trying to accomplish in the end is selecting all the curves that touch each other as a chain. In this context to understand the extent of the river tributaries connected to the Saint Lawrence.

Hi Melissa - selecting as a chain is what I thought you were after but this gets to be very, very time consuming with thousands of candidates like this - I have something working, more or less, but it is still pretty crude and unacceptably slow in your file.

@melissawall63 @Helvetosaur - with considerable logic-help from @chuck, this seems to work… I think. It is still not super fast, I can do one or two things more, perhaps, to speed it up by trying to identify and leave out from the process at least some of the obvious non-candidates. I have not done that yet here, but I’d say it would help to a) select and hide as many of the isolated curves as is convenient, and b) select everything and Join before running this, to reduce the sheer number of curves somewhat. It takes between 2 and 3 minutes, here, to finish in your example file but it seems to get all or most of it right. It does not group - it could do so, or move the curves to a different layer or whatever, but for now, use the Group command when it’s all selected.

SelTouchingCurves.py (2.5 KB)

-Pascal