Grasshopper

algorithmic modeling for Rhino

Hi all,

I'm currently having some weird results with the list insert component, but it's maybe because it is not the right logic for what I'm trying to do: I would like to replace precisely defined entries (numbers) in a list, by some other numbers (in a different list) using their index:

For exemple, replace the list item n°5 by this number.

 

I saw that there are already some topics on this (sptember/november) but I did not found solutions in it... Here is the thing:

The values are coming from a simple comparaison between to list: when a value is found then it gives its index (and then I would like to use this index list to replace some values in a similar list):

 

"Search "123" in this list" --> "Oh, there's one in the index 24" --> "Ok, so say to this list that it has to update with this new value at the same index".

 

If someone has a clue...

Thanks for your help,

T.

 

// Hors sujet: For the french guys out there: I'm working on the french translation of the GH Primer, it will be out in a week or two :) // 

 

 

Views: 931

Replies to This Discussion

How's this?

 

Chris

Thanks Chris,

Well, I tried this but it is not giving right values, I dont know why... I post the entire file here : 

 

 

Attachments:

here you go.

 

The component is under Extra|Sets.(no icon)

 

Attachments:

hey, that's a great component!

i would have a comment though - it doesn't work if he receives a null list in the index hook, which means he must at least modify 1 object, which makes it less parametric (in my case i have this slider that tells the algorithm what percentage of a group of objects should suffer an alteration, and if i want to make that number 0, it gives an error since no indexes are provided)

 

It looks like the numbers I choose in my own example just happened to work out with that def.

Add the (0,1,List_Length) series component as shown above.

 

Chris 

Thank you so much to both of you, your two solutions are working very well!

Best,

 

TS.

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