Grasshopper

algorithmic modeling for Rhino

Using hoopsnake to add values to a list while in loop using python

Hi Guys,

I'm not sure if this is possible using python but I want to code these python components in such a way that the list that you see in the group at the bottom of picture becomes a list of 5000 items when hoopsnake loops 5000 times.

The problem I'm having is that everytime hoopsnake loops the states of all the connected python components reset so they cant store anything!

Is there anyway around this using python? Or do I need to dive into the language that Hoopsnake is using?

Views: 1004

Attachments:

Replies to This Discussion

You can pickle (serialize) Python objects to a text file and then unpickle them the next loop around. There has to be a way of indicating whether it's the first time around though (loop =0). It's a little weird but it works in a pickle.
I suppose you could also send the pickled Python data through hoopsnake as well.

Not quite sure what you're trying to achieve, but it sounds like you could use the RhinoPython sticky feature for this. See this thread for a simple example. I wonder why you're not just using Python for whatever looping Hoopsnake is doing though ;)

did you solve it? if yes, please do share how

V

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