Copy and move the element changing the parameters

hi :slight_smile: im very new with grasshopper and i need a little of your help. i’ve designed this structure and the algorithm gives me some parameters like rotation of the posts and the distance between them, radius of the suspended module etc…
in my project i need to copy this structure many times in different places with different parameters, i could copy all the algorithm again, but i’d like to know whats the sortest or optimum way to copy 3, 6 or 9 times this module and have the hability to change the left column of parameters for each copy.


There are several approaches that will make sense under different circumstances.

  1. If you need multiple instances at the same time, then you need to make your file multi-instance-correct. This may involve some judicious grafting or path-mapping in strategic places, but ultimately if you provide not one but nine input values, you should get not one but nine output assemblies.
  2. You can abstract the above approach by putting the logic which creates a single assembly into a cluster, and nesting that cluster inside a file whose only job is to provide the instantiation values for each individual object. I personally like it if a file only deals with a single level of complexity, I find it keeps thing more readable.
  3. You can also abstract it by not just creating a cluster which has umpteen inputs (numbers, points, etc.) but which only takes a single input in text form, then parses that description. For example if each instance of your shape is defined by three points A, B, and C, and four numbers x, y, z and w, you can format all that data as text in the form "A|B|C|x|y|z|w". Then your clustered file splits this text at | symbols, parses the points and numbers and eventually creates the shape. The benefit of this approach is that you can describe each shape instance using only a single datum, rather than some collection of synchronised points and numbers. Downside is you have to add formatting and parsing logic.
  4. If you don’t need the shapes simultaneously, then perhaps you can make use of the Data Output and Data Input components. Create one file which sets up the variables and write those to a ghdata file, then read that ghdata in another file which creates the shape. This connection is live, so you can switch between different instances pretty easily. You can even cache ghdata files and swap them out in Windows by hand.
1 Like

I’m supposing that the best for me is option 2, because i want the shapes simultaneously and i see option 3 too difficult right now.
i think i can understand what you’re saying in the option 2 but i’ve never used clusters so i don’t know how it works and how can i implement it in my project. any clues? i’m going to try to investigate and learn how to do it this afternoon.

thank you for the quick answer :slight_smile:

edit: okay so i’ve selected all the algorithm except the parameter sliders and created a cluster. now i have a cluster that i can edit and i can copypaste and change the parameters for each instance. i suppose this is what you explained in point 2