algorithmic modeling for Rhino

I made a little VBscript that remove duplicate values from a single list of numbers. It's not optimized but it works. Use it, test it and letme know. As usual, hints ad upgrades are welcome. Bye.


Tags: VB, duplicate, remove, script, value, values

Views: 2780


Reply to This

Replies to This Discussion

cool, thank you!

Hi Paolo,


see attached. It's a bit smaller (and I think quite a bit faster, especially on large lists). I added comments to the code, but here it is without:


Dim lut As New SortedDictionary(Of Double, Boolean)       

Dim result As New List(Of Double)      

For Each value As Double In Values            

    If (lut.ContainsKey(value)) Then Continue For            


    lut.Add(value, True)


A = result



David Rutten

Poprad, Slovakia




what to do for string duplicates?

Dim lut As New SortedDictionary(Of String, Boolean)

Dim result As New List(Of String)  

You can use any type you want as long as it provides it's own CompareTo method. If it doesn't, then you'll have to provide the SortedDictionary with a custom delegate which performs the comparison.


David Rutten

Poprad, Slovakia

Thanks David

(it's always a pleasure learning from the master)



Search Grasshopper


  • Add Photos
  • View All

© 2015   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service