Grasshopper

algorithmic modeling for Rhino

I am trying to remove the null values from a list of planes, and output the clean list of planes.

Sub RunScript(ByVal x As List(Of OnPlane))
Dim CleanList As New List (Of OnPlane)
Dim i As Integer
For i = 0 To x.Count() – 1
If x(i) = Nothing
Return
End If
CleanList.Add(x(i))
Next
A = CleanList
End Sub

Views: 606

Replies to This Discussion

This should work:

Sub RunScript(ByVal x As List(Of OnPlane))

Dim CleanList As New List (Of OnPlane)

For i As Int32 = 0 To x.Count() – 1
If (x(i) <> Nothing) Then
CleanList.Add(x(i))
End If
Next

A = CleanList

End Sub
You can also use the "Clean Tree" component.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service