Grasshopper

algorithmic modeling for Rhino

I have a list with some numbers.

Now, I want to exclude the first and the last value in the list.

 

Or exclude the first two and the last two values in the list. How can I do that?

 

Thank you.

Views: 9306

Replies to This Discussion

cull

thank you for the reply. I am still a Grasshopper beginner. Here is what I got from the "Cull" help:

 

As far as I understood this means I need to edit my Boolean value manager each time I change my list.

List that has 10 values in it, does not satisfies with the same "true, false" order as a list that has 9 values in it.

 

An example of a Cull Pattern operation. Input:

List = {A, B, C, D, E, F, G, H, I, J, K, L, M, N}
Pattern = {True, True, False, False}

Output:

List = {A, B, E, F, I, J, M, N}

 

So either I did not understand this "cull" component, or this is not a way to solve this problem.

I am looking for universal solution, that will allow me changing my input lists, but that will always result with excluding the first and last values from the list; or first two, and last two; or first three and last three... and so on.

 

sorry for the brief response, I am at work and saw your inquiry and wanted to give some hint of what to do in the few seconds I had. You are correct cull pattern is a Boolean operation. I meant to use cull index. Again it was a very brief suggestion "not thought out". Dimitri's suggestion seems accurate for more complex situations. Here is what I was talking about. Only good I think for the first and last of lists. 

Hi Djordje,

is this what you're trying to do?

 

 

Dimitri

yes!

I just need the rest of the list, without the excluded values.

So I need the middle part of the list without the first and the last, or the first two and last two and so on.

 

P.S.

 

your components look different than the ones in my Grasshopper. Are you using the newest Grasshopper version or Rhino v5?

he is in the draw icons mode in grasshopper. View>Draw icons.

here you go (see the attached file)

 

 

 

Dimitri

Attachments:

a bit simpler

 

Attachments:

And even simpler :

(Shift List component)

And even:

Just kidding :)

lol
Hehe

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