WISH: SelSame, A Better Version of SelDup

Continuing the discussion from Wish compressed file:

This wish may also help with the Compressed File wish

SelDup only finds literal copies of each other, and not objects that are geometrically and spatially identical. A matching algorithm that would find geometrically identical objects would be a godsend. Two ways this would be beneficial. A) not storing geometrically duplicate objects in a file, just their spatial and meta attributes. B) Find geometrically similar objects and convert them to blocks, edit definition, update all block instances, explode them.

I have made wish requests for Blocks before. They are great, but have their challenges as well. Sometimes I don’t use them because I can’t see them changing and kick myself later. There is no way to update a group of identical objects without deleting them and re-array or re-flowing them.

1 Like

Here is a start I made on some of this stuff, I have a bunch of ideas to do more with this, but unfortunately my scripting time is running out for this semester - things are already getting rather crunchy…

–Mitch

1 Like

Hi,
I have just needed to select all circles made with an array , selsame I expected to be there and I click first circle and it selects the remainder going by size and colour.
How is such done ?

seems we need this simple command.

I try seldup and it says no duplicates found.

Cheers
Steve

SelDup was updated in V6 to return geometrically identical items, i.e., size, shape, and location. Meta properties (layer, color, etc.) can be different. That’s not what you are looking for.

If an array made it, you pick the original and call _SelChildren (if record history was turned on).

Rhino has dozens of handy _Sel commands, but it pays to be creative. If I needed to find a dozen circles that had a radius of 5 mm amongst 100s of objects, I’d do something like:

//eliminate anything that can't be a circle
SelClosedCrv
Invert 
Hide

SelPlanarCrv
Invert
Hide

// only closed planar crvs are left

// now filter by size using the diagonal of a bounding box
// diagonal of a square fitting a circle is = 2 * radius * sqrt(2)
// 2 * 5mm * 1.41 = 14.1mm 
SelSmall 14
Hide
SelSmall 14.2
Isolate

//left with closed planar crvs that are approximately the right size

Here’s a list of _Sel commands.

SelDup has worked this way since V1.0 as far as I know. Some adjustments have been made such as identical lines or circles but whose direction is opposite.

You might be right. It’s been many years since I had to deal with this, but I thought I remembered it being a PITA to separate duplicates on a target srf if I accidentally reflowed something.

They really have to be geometrically identical including the underlying NURBS structure etc. i.e. they have to be exact copies data-wise - which isn’t always user friendly, as for the user they might be as good as identical, but since some element deep in the NURBS definition of the object is different, they won’t select with SelDup.

I have a number of scripts for selecting “near-dups” within a given tolerance.

Currently it’s most easily done with a script.

Rhino is perhaps the program that allows the most incredibly fine, granular object selection possibilities of any CAD program - but most things beyond the basic object classes and characteristics do require some simple scripts. Why?

Because there are already more than 100 Sel… commands in Rhino. You could multiply that by at least 10 if you want to have more options and that’s just scratching the surface (think permutations/combinations). In my selection scripts library I have 7 sub folders, some of those have 10 sub-sub folders and there could be a dozen script files in each sub-sub folder… You get the picture. The selection criteria are virtually unlimited.

Here are a couple:
SelSameRadCircles.py (1.0 KB)
SelByRadius.py (2.8 KB)

Note they simply test for radius, not for color, so same diameter red and blue circles will both select.

Hi,
Is there a script for allowing user to select a solid or line or circle or whatever, and it finds all copies made of it with array or copy or mirror (when its a circle or square etc)

as life will see users make copies of many things, not just circles.

array and tween and copy make same copies, no subtle nurbs changes, am I right ?

Steve

_SelChildren

If History recording is on and the objects (children) haven’t been moved or otherwise modified so as to break history…

Yes. As a matter of practice, I try to:

_SelChildren 
// remove parent from selection if you have DeselectOthersBeforeSelect=No
_Group

I find that a more straightforward method to keep up with hundreds of children that spawn from a parent and helps me edit the one I intend to.

Hi,
V5
I have arraypolar a line, I select it, I run seldup, nothing happens, I try selchildren, nothing happens. I am doing so in perspective view.

Why cant we have SelSame and everything matching the first item selected gets found ?

What is there that is easy to remember such as selsame to select lines or curves cloned from another ?

be it array or other command such as copy ?

Basic stuff…

Cheers
Steve

If SelChildren didn’t work, then you might not have Record History on:

image

Either that or you broke history at some point. Some people use the history break warning, and I use lock children…each is painful in their own way.