Grasshopper

algorithmic modeling for Rhino

Hello guys,

I wonder if there is a way to convert a list of GH items into a list inside the Python component?

Here a quick example, I want to get the same results from a mass addition without changing my 'item access' into 'list access' (I need the items for other things), is there a way to do it?

Thanks!

Views: 1140

Attachments:

Replies to This Discussion

Hey,

I do not do a lot wit python component, but in general, the thing u are asking is against the concept.

Lets take ur list. Contains 3 elements.
And a component with a single input.

So, the code in the component ...
- with 'Item-Access' runs 3 times.
- with 'List-Access' runs only once.
- with 'Tree-Access' runs always once (but this is an other thing)


U have to choose one for ur code to run.

So if u need both, the list and the item, choose 'List-Access', and do a for OR foreach loop in ur script to take care of each item.
If u are going to have multiple inputs with different Access (ex. item, list), things are going complicated fast because of the matching (item-from-tree + list-from-tree) done internally by grasshopper,

Hope this helps somehow
Greets

Thanks for your response!,

I wanted to avoid using loops and just let the different 'items' inputs take care of themselves.

But I guess I'm just going through the learning curve of scripting and will have to jump into the waters of data coordination...

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service