Grasshopper

algorithmic modeling for Rhino

Couple of newbie questions about structuring & reusing 'programs'

Hello Grasshopper users,

I am quite new to Grasshopper and this style of working (I've more experience with traditional coding), but enjoying it tremendously.  I'm trying to familiarize with the "right" (idiomatic) and easy way of doing things.

So here come some basic questions:
  1. Is there a way to create custom components by grouping an existing sub-network together?  I'm looking for a way to re-use parts of a program (something similar to subroutines), and to make the network look less cluttered.  I found that it is possible to group components (ctrl-g), but this still displays them as separate blocks (too much clutter), and provides no way to re-use a sub-network in such a way that if it is modified in one place, all it's instances (all the places where it is re-used) also get modified.

  2. Is there a component that does nothing, just passes a signal through?  Suppose I need to connect block A to blocks B1, B2, B3 (all three get the same input).  Then I change my mind, and I decide to connect block C to these three, not A.  In this case it will be necessary to change three connections, not just one.  I'm looking for an easy way to do this by a single rewiring, not three.  (This came up in a practical situation).

  3. Finally, a related question: is there a component that acts as a switch, so I can choose which signal it passes through out of a possible set of choices?  For example, suppose that a set of objects can be coloured based on a number of different properties (size, positions, rotation, etc.)  I'm looking for a way to switch between these very easily, without the need to do much rewiring.

Thank you in advance for any replies / useful comments, even general ones on how to easily structure a large Grasshopper program/network.




Views: 302

Replies to This Discussion

Welcome Szabolcs,

Answers to questions Yes (sort of), Yes and Yes

1. Clusters have been removed from the program on a temporary basis whilst there is a re-write of the code. They worked as you described. Also there is a development in v0.7 which enables you to define User components based on something you have created on the canvas. This will apply to multiple components soon.

2. Simply use either a Geometry or Primitive Param Component like Pt. The data is not copied until it is changed or transformed.

3. Have a look at Stream Filter component (right click to get Input Manager to add more options) you supply an integer to choose the gate from which the input is selected.
1. For the time being, NO. 'Clusters' used to exist at some point, but they've been taken out for a while now, as they were somewhat buggy+messy, plus they were only a visual clustering, not really instancing another file as you mentioned. The new revamped ones are on their way, and should be released soon. I think they would have the instancing functionality built in, though there's only one man on the planet who can tell for sure. And looks like he's been off the last few days.

2. This query is not so clear.. could you illustrate it? If you make 3 connections to the same input, you can disconnect all 3 in one go by right clicking on the input and selecting 'disconnect all', but if you have 3 connections from a single output going to different inputs, then you'd have to take the manual way. In terms of 'doing nothing' components, nearly all components in the 'Params.Geometry' and some in the 'Params.Primitives' section do nothing but either pass values on, or reference objects in Rhino, or store values.

3. Look at Sets.Trees.Stream Filter and Sets.Trees.Stream Gate.
Thanks for for the replies Danny and Suryansh!

These are exactly what I have been looking for. I guess clusters might be back in 0.7 then.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service