Grasshopper

algorithmic modeling for Rhino

How to remove equal data from list (made by randomizer)?

So on: How to remove equal data from list (made by randomizer)?

Views: 284

Replies to This Discussion

Hi you could try and use this code below its super basic and sorts your data and checks that there are no numbers that are duplicate.

Copy the code into a VB component. (except the first an last line!)

Sub RunScript(ByVal aList As List(Of Double))

Dim nList As New List(Of Double)

aList.sort()

For i As int32 = 1 To aList.Count - 1 Step 1
If Not aList(i - 1) = aList(i) Then

nList.add(aList(i - 1))

End If
Next

a = nList

End Sub
tnks.
in perspective it will be good if dublicats will "reseed" to make "number of data" parameter more clear.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service