Grasshopper

algorithmic modeling for Rhino

Hi,

The following script gives me error saying "public member 'count' on type 'double' not found. (line: 0)" 

The script was created with old grasshopper, how do i convert it to be functional with the new grasshopper?

Private Sub RunScript(ByVal value As Object, ByVal minVal As Object, ByVal maxVal As Object, ByRef pattA As Object, ByRef pattB As Object, ByRef pattC As Object, ByRef pattD As Object, ByRef Test As Object)
Dim dom As Double = maxVal - minVal
Dim I As Integer
Dim K As Double
Dim A(value.count-1) As Integer
Dim B(value.count-1) As Integer
Dim C(value.count-1) As Integer
Dim D(value.count-1) As Integer

For I = 0 To value.count - 1
K = (value(I) - minVal) / dom
If K <= 0.25 Then
A(I) = 1
B(I) = 0
C(I) = 0
D(I) = 0
End If
If K <= 0.5 And K > 0.25 Then
A(I) = 0
B(I) = 1
C(I) = 0
D(I) = 0
End If
If K <= 0.75 And K > 0.5 Then
A(I) = 0
B(I) = 0
C(I) = 1
D(I) = 0
End If
If K <= 1.1 And K > 0.75 Then
A(I) = 0
B(I) = 0
C(I) = 0
D(I) = 1
End If
Next
pattA = A
pattB = B
pattC = C
pattD = D
End Sub

Views: 434

Replies to This Discussion

your "value" input needs to be a list.  you select this by right-clicking on the input variable in your vb component and selecting "list access" instead of "item access"

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