Grasshopper

algorithmic modeling for Rhino

I'm having a premature senior moment and all of a sudden a really simple task is throwing me for a loop. I have a series of lists of numbers, 6 to be exact, and I need each list to be in its own separate branch of the same data tree. The list of numbers are being constructed from scratch, nearly manual input of a series of numbers. I can't for the life of me, figure out how you would get each list to be its own branch, in effect grafting not each entry but each resoective list. Not sure if that's clear enough.

Help? Thanks!

Views: 1062

Replies to This Discussion

You will always have exactly 6 lists (not n lists)?

If you use [Flatten] you can assign a path name to the P input, so:

{0}
{1}
{2}
...etc for each of your 6 lists. Then you can [Merge] them and you'll have a tree with 6 branches.

This, of course, isn't a dynamic way to assign path names but it works.
so simple...I don't think I've ever had to do that before...thanks alot. Was completely stuck without that
Hi TAZ,I really appreciate the “Flatten+Merge”workflow~!And I think it is very useful anyway. The only question is sometimes you have to assign too many Flatten components if you have a lot branches,doesn't it?? In fact, I ask for a solution here and here,but with no luck.I am an unhappy man now.
The only thing I can do now is just waiting for someone could script a more powerful Flatten conponent than the standard one.what do you think??
Alpha,

I think you were on the right track with using [Replace] but I don't think you had it set up quite right. Try one of these two options to rename your paths:

Thanks Taz,this is just what I was after!!But can you explain a little about the expression you used in option 2??Thanks.

BTW,Since we already have the powerful PathMapper component,we use ReplacePath component very little now.Then is it possible to add the expression into the ReplacePath component to simplify the process showed in your picture??Maybe I should ask David for it...
[Replace] is a bit old, but it's still necessary to reassign specific path names. This is one thing [Path Mapper] just can't do.

If there is ever a version of [Path Mapper] that allows inputs other than just the tree structure then it might be possible, but this is up to David.

The expression uses standard functions from the expression library. All it does is remove the first and last character of the input string by checking the length of the string. SubString is another function that should also work, but I've never had any success using it.

ciao taj,
by the way what is this text image that you attached,
can you kindly share, i think i need this one as resource,
thanx
Ciao Ricardo,the image you are looking for is simply the function lists.
You can see it in this way:
drag a function component (a lot of others component are able too) on the canvas,click with the right mouse button and select Expression editor,now you can see the Expression Designer.
If you click on Display function list,you will be able to see that image.

Function list.jpg

Luca
Thank you so much taz!! I think I should dig into and learn more about the expression library.
I just found Taz's solution, and it is extremely useful for removing specific elements from a list of branches and then folding them back in at a later stage in the process.
For example, in the image below, I've taken some of the faces of a polysurface and subdivided them, and then I can put these new sets of 9 subsurfaces back into a list where there was once just single surfaces. Check out how replace branch lets me shuffle two things together:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service