Question from Melanie W: I´m struggeling with the question how to animate serveral sliders to get all possible combinations as a result. i know thats not a new topic, i read everything i found in the net, but found nothing to solve my problem yet, hopfully i´m lucky here. i want to make a parametric study including the diva plug in and i want to simulate all possible combinations e.g of an geometry which hast 3 variables or more. how can i run an animation with every combination possble? i´ve got one slider: for the hight, 2.2-3.0m, one for depth depending on the month of the year: 4-10 (april to october) and another for the reflexion (if i´ll get it work): 0-2, perhaps later i want to add more variables.
Tags:
Hi Melanie,
I have posted this as a new discussion. I am sure their are many ways of achieving this. I cycle through multiple parameters by creating a single "meta" slider which controls the input to the other components (using a single slider for the whole definition), with a custom VB component. Basically, you nest a bunch of for-next loops to populate an array with all the possibilities and then use the slider to index the values in the array. For a simple definition with 2 sliders, each integers with a range of 0 to 2 (so a 3 x 3 matrix with 9 possibilities), the VB script might be written:
Private Sub RunScript(ByVal x As Object, ByRef A As Object, ByRef B As Object)
'''''''''''Fill a 2 dimensional array with all the permuations (slider A is matrix(?,0), slider B is matrix (?,1))
Dim arr_permutations(8,1) As Integer
Dim i As Integer = 0
For j As Integer = 0 To 2
For k As Integer = 0 To 2
arr_permutations(i, 0) = j
arr_permutations(i, 1) = k
i += 1
Next
Next
'''''''''''''''''for the slider input x, output the values
A = arr_permutations(x, 0)
B = arr_permutations(x, 1)
End Sub
Attached is a grasshopper definition with this VB component. Another approach would be to use a text file to define the upper and lower bounds of each output parameter for a range of input slider values, thus allowing you to "choreograph" a definition.
Jeff
hello jeff!
thanks again for your help, it´s that i´m not used to VB but now i manipulatet your definition and ist works fine.
if someone has another suggestion: let me know.
best, melanie
Hello Melanie, I run in to this yesterday. Hope it helps:
http://genoform.com/ (check the videos)
http://www.food4rhino.com/project/genoform
(download link)
cheers
hello claudio!
thanks for your help, i allready downloaded genoform but i was a bit in trouble getting it work.
for now i´m happy with jeffs solution, but i´ll try to run genoform.
i´m not so sure if it will work together with diva, did you try?
best, melanie
Getting Started
Advanced DIVA for Rhino Concepts
Simulation Types
Tips & Tricks
© 2020 Created by jeff niemasz. Powered by
thanks for your hints.
melanie