algorithmic modeling for Rhino
Private Sub RunScript(ByVal d As Object, ByVal r As Boolean, ByRef A As Object)
If r = True Then
out_list.clear
Else
out_list.Add(d)
End If
A = out_list
End Sub
'<Custom additional code>
Dim out_list As New List(Of Object)
'</Custom additional code>
End Class
This one is closer...not exact in terms of use, as the native component recognizes when the input values change, and I'm not familiar with how it does that. Use a boolean toggle for record, and the button for reset.
Private Sub RunScript(ByVal d As DataTree(Of Object), ByVal record As Boolean, ByVal reset As Object, ByRef A As Object)
If reset = True Then
out_tree.clear
ElseIf record = true then
For Each p As GH_Path In d.Paths
Dim out_list As List(Of Object) = d.Branch(p)
out_tree.AddRange(out_list, New GH_Path(p))
Next
End If
A = out_tree
End Sub
'<Custom additional code>
Dim out_tree As New DataTree(Of Object)
'</Custom additional code>
Left out the record part, since it didn´t really help. Would be interesting to get to known Davids (the other one) method for this.
Everything else is exaclty what I was looking for.
I think I got a little closer to understand some things better now.
Thank you!
I would do the same as David suggested. As you suggested, there is no need for the "record" parameter. "Setting the "reset" toggle to "true" clears all values, setting it to false again, starts recording.
------
Private Sub RunScript(ByVal data As DataTree(Of Object), ByVal reset As Boolean, ByRef Rec As Object)
If reset = True Then
out_tree.clear
Else
For Each p As GH_Path In data.Paths
Dim out_list As List(Of Object) = data.Branch(p)
out_tree.AddRange(out_list, New GH_Path(p))
Next
End If
Rec = out_tree
End Sub
'<Custom additional code>
Dim out_tree As New DataTree(Of Object)
'</Custom additional code>
well...I only added it the second time in order to approximate the existing component...the record/reset parameters are there in order to be able to stop recording without removing the current output...:)
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by