Grasshopper

algorithmic modeling for Rhino

This is a question related to my previous post:

http://www.grasshopper3d.com/forum/topics/python-class-loop-recompu...

I have a Python component in Grasshopper that ouputs a specific instance of a class object with some data. Is there a way to export this data to a file, so that I can simply "import" it back into the Grasshopper environment in the future for reference? With the project that I am working on (link above), every solution is unique and it is nearly impossible to duplicate (unless done manually) so it would be good to have a record of each solution. 

Views: 811

Replies to This Discussion

You might want to have a look at pickling. It is my understanding that several people on the forum have successfully implementing this approach. Depending on the data type, you could also store data in the UserDictionary property of most RhinoCommon geometry objects. That way you could store it in a Rhino document. Not sure that'll work with custom class instances though. It's an interesting subject, would love to hear what you come up with. Best, Anders

Edit: Also, while you are creating the instances you can stuff them into the sticky dictionary. Then once you're done you can write/pickle them to a file. I suspect that would be faster since you're only writing to memory and not a file.

Unforunately UserDictionary doesn't support custom instances of objects > http://discourse.mcneel.com/t/assign-a-function-to-an-object-using-...

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service