algorithmic modeling for Rhino
Hi, I am pretty new to grasshopper and have very little VB experience, so as you can imagine the learning curve is steep trying to create a script for grasshopper. I am trying to create a script that will take a list and go down the list one by one and calculate an array. It gets complicated in that the array created is the the length of the list squared and has data calculated based off of the value in the array immediately preceding the new value calculated. I added the errors I am getting in the code, but I suspect there may be more issues.
Private Sub RunScript(ByVal Dist As Double, ByVal Scale As Double, ByVal Speed As List(Of Double), ByVal ActVol As List(Of Double), ByRef Basis As Object)
Dim Val As Integer = (Dist / Scale) + 1
Dim Ref As Integer = 1
Dim Index As Integer
Dim Above As Integer
Dim AIndex As Integer
Dim Below As Integer
Dim BIndex As Integer
Dim Cal (Val^2) As Double
Do While Ref < Val
Index = (Ref - 1) * Val + Ref
Cal(Index) = ActVol(Ref)
Above = Ref + 1
Below = Ref - 1
Do While Above <= Val
AIndex = (Ref - 1) * Val + Above - 1
Cal(Index) = Cal(AIndex) + Speed * Scale * (ActVol(Above) - Cal(AIndex)) Error: Opperator '*' is not defined for types 'System.Collections.List(Of Double)' and 'Double'
Loop
Do While Below > 0
BIndex = (Ref - 1) * Val + Below + 1
Cal(Index) = Cal(BIndex) + Speed * Scale * (ActVol(Below) - Cal(BIndex)) Error: Opperator '*' is not defined for types 'System.Collections.List(Of Double)' and 'Double'
Loop
Ref = Ref + 1
Loop
Basis = Cal
End Sub
Tags:
cal(index) = cal(aIndex) + speed * scale * (actvol(above) - cal(aIndex))
^^^^^
cal(index) = cal(aIndex) + speed(above) * scale * (actvol(above) - cal(aIndex))
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
© 2024 Created by Scott Davidson. Powered by