Grasshopper

algorithmic modeling for Rhino

Save internalized grasshopper geomerty while preserving the tree structure

Hi guys,

   I have a large tree data, where each branch of the tree contains many meshes. This data component's existence makes my gh file save extremely slowly. But what I need is to access each branch individually (I use a C# componet to visit each branch of the tree in a loop). Thus, it could be good if I can save each branch of the tree into a .3dm file to an external location (thus I get 192 .3dm files for each branch) and I can visit them by indicating the file's name in each iteration and read it in C# script. (read and generate a List<Mesh> ...)

   I've searched about something like this in our forum and look at some relevant components. Like in elefront, they first convert object as IGH_GeometricGoo, and use goo.IsReferencedGeometry or directly cast it as GH_Guid. And using Rhinoscript mimicing our mouse click the object in Rhino and then Rhinoapp.RunScript("-Export" + ...)

  But my data is purely in GH, because the data is a result of long logic of gh computation. Thus,

             in order to save it,       I need Guid of each mesh;

             in order to have Guid,  I need the models to be referenced (baked in Rhino)

             in order to keep the data structure, I need to bake and delete one by one (bake one branch, collect the Guid, save it in elefront method (the 3dm file's name is related to the branch number), delete the baking, repeat for next branch).

   This might be doable but really exhausted... Is there easier way to obtain the guid, and save it? Or there's other type of data structure that I can rely on, allowing me to save it externally and read it back to mesh, without using the guid and Rhino <save> script?

   For clarification, I enclose the data tree here (I simplify the tree to 3 braches because there's a file limitation...).

   Thank you for your time and patience!

Best,

Yijiang

Views: 666

Attachments:

Replies to This Discussion

I had a related problem quite a while back, and unfortunately I can't find the file anymore. But I think I used Lunchbox's bake component. I cycled through the geometry I needed, baked it, saved it, selected all and deleted all objects, then went on to the next branch. Not sophisticated, but it got the job done! 

If it helps, this was the component I used to do the looping: http://james-ramsden.com/looping-through-the-grasshopper-canvas/

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2021   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service