Grasshopper

algorithmic modeling for Rhino

Hello guys?
I am dealing with simple problem which has to retrieve (show) the "n"th index from a panel. In other words, i have given a list which has 9 items inside and based on some condition i want to know the number of index of that particular item. 
For better understanding, I am attaching the image here below. As we can see, the left hand side panel(data tree) has 9 elements (branches) but only one element (item or branch has exact data. Therefore my goal is to know and display what number of branches has item inside in the panel. 
Its like List Item component but opposite. I have checked the forum and some tutorial but couldn't find something similar yet. Moreover, I could probably use dispatch to get rid of empty branches but i need to record these numbers in a panel for further development. 

I hope you understand my point and hope you have a suggestion. 

Thank you.

P.S. grasshopper definition is attached
 

Views: 4781

Attachments:

Replies to This Discussion

Here is probably the ugliest solution you will ever get!

Attachments:

Thanks Martyn Hogg it works well

Hello

if this is for finding empty or not branches you could also try the two following ways,

best

alex

This one also works. Thanks

Hello guys was correct awkweird ;)
Here's my suggestion:

Attachments:

Why I haven't noticed the list index component before. Anyways it works so well thank you

This seems to work too.

Attachments:

Thank you for the help . I got the idea 

oh, this too lol.

best

alex

That gives you a string representing the path but you can get ugly with some text components to turn it into an integer!

Didn't know this one was such an easy one.  I should've looked up first before posting.  Anyways thanks for the all suggestions guys~

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service