How to find Duplicate objects

Hi,
how to find duplicate objects which are instances of original one. or else how to identify the original objects?

1 Like

Hi @vijay_sarathy,

You can try using GeometryBase.Equals,which is used by Rhino’s SelDup command.

– Dale

1 Like

Hello @dale
Can you please provide example (.NET) of using GeometryBase.Equals for the List of geometry?

I did a simple check where each object is compared with another one: loop within loop.
But in case of large number of objects (n>5000) it works very slow. SelDup, however works extremely fast. :slight_smile:

I have also noticed that GeometryBase.GeometryEquals method exists. What is the difference between both?

Thanks in advance,
Dmitriy

Hi @Dmitriy,

GeometryBase.Equals determines whether two object instances are equal.

GeometryBase.GeometryEquals determines if two geometries equal one another, in pure geometrical shape.

The SelDup command sorts objects into lists (points, curves, Breps, etc.) and then does some fancy sorting to objects that might be similiar are close to each other in the list.

The SelDup command is scriptable if needed.

– Dale

Thanks, @dale

I am checking and modifying geometry for each InstanceDefinition under InstanceDefinitionTable by applying ModifyGeometry method. So, I am not sure how can I use scriptable version in this environment.
Maybe it is possible to add equivalent of SelDup to RhinoCommon?

Thanks,
Dmitriy