Grasshopper

algorithmic modeling for Rhino

Hi!

 I would appreciate very much some advice, as this seems something really easy to do but I can't find a way.

I have a list which recognizes I have several branches: it goes (0;1), (0;2), (0;3)... etc. and (1;1), (1;2), (1;3)... etc. I need all the (0; ...) into one list and (1; ...) into another.

The thing is I can't use split nor dispatch because I need to be able to add new branches or more points and to separate the list according to the first number.

Thanks a lot!

Views: 8722

Replies to This Discussion

Can you upload the gh file 

This is my first shot at solving a problem in this forum and I am still pretty new to Grasshopper but i believe that you can solve it with the following configuration. Perhaps there are a more elegant solution out there 

thank you! that is a good start and it allows me to keep working

http://www.grasshopper3d.com/forum/topics/retrieve-multiple-branche...

edit:

sorry, I just saw your last sentence. Can you explain what you mean by adding branches later on?

You might have branches like {3;n}, {4;n}, etc?... Is this limited (ex. they won't go above {5;n}) or not?

Exactly. But it would be "unlimited"

In any case I believe the [ExplodeTree] component (using the zui feature to add outputs) should be helpful:

If you don't mind trimming (Pshift) your tree before, like Lasse suggested then things get less compicated

BUT,

you should keep in mind that as your tree structure changes, the outputs will also change and you would have to keep adding/removing outputs and changing wires.

It troubles me though, that you say you might have unlimited branches..   It doesn't really make sense, because if you want to split them, then it means that you want to take each one of them and do something different, so how will you pre-build your definition if you don't know the number of branches? If you don't mind sharing your definition and explaining why you want to split the tree, there might be a simpler and more efficient solution.

cheers, nikos

What I wanted was to set some relationships between {0;n} and {1;n} than then could be repeated when adding {2;n}, {3;n}, {4;n}... But I can keep working with Pshift for the model I need right now. So, thank you!

Attachments:

Ok, just as I thought, it is not a good idea to split your data tree at this point in your definition.

What will you do if you want to add more branches (another array of lines)?

Copy-paste this big part of the definition and start connecting wires again?... that's too much trouble and it, kind of, takes away the "parametric" from your design.

Instead, I suggest you take the time to study what data trees are and how they behave and try to work with them instead of exploding them to simple lists.

this is how you could produce all the lines you need with fewer components, without splitting your data and mainly without the need to grow your definition as the data changes:

Attachments:

Get this small tutorial as well (3 ways to skin a cat)

Attachments:

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