Grasshopper

algorithmic modeling for Rhino

Hi there,

I'm fairly new to Python in Grasshopper and have a question about how to access data trees.  I was taking a look at some of the information on this thread:

http://www.grasshopper3d.com/forum/topics/datatreelistitem-access-f...

But am still stuck and was wondering if anyone could lend a hand.  I simplified the script but what the end goal is, is to take hourly climate data (8760 values) for relative humidity and split them into groups based on their values (i.e. 1-10, 10-20%, 20-30%) and then run each of these groups into it's own tree to color them accordingly for an export to illustrator.

I can write a simple one as you can see in the script that at least removes a few grasshopper components but when I do x and y it all just gets merged into one list and overwrites the Trues and Falses.

Any help is greatly appreciated.

Thanks!

-Kyle

Views: 2939

Attachments:

Replies to This Discussion

Hi Kyle,

The Benjamin's link you attached does not create a separate datatrees, but a separate branches on a datatree.
If that is what you are looking for, then try this one:

The "domainN" input are percentage groups you are looking for.

Attachments:

Hi Djordje,

That was just what I was looking for, thanks very much for your prompt reply.  The script successfully sorts them into groups.  I was hoping to run all of the values through each domain and then output branches containing the (8760 values) list length in a true false pattern to use as a dispatch.  Maybe there is an easier way to do this that I am missing? 

Is there a way to just retain the index values of the sorted lists so that I could sub-list geometry using the same pattern?

Thanks

there you go!

Best,

M.

Attachments:

Thank you Marios, thats great.

Is there a reference for the correct syntax, i.e. ghdt[object] vs. [system.double]? 

I can't seem to find anywhere that lists all the methods for the Grasshopper.Kernal.Data and Grasshopper.DataTree

Object will take any kind of data into your branch list: integer, double, string, geometry...
Double will only take real numbers.

Object covers all the possible variable cases. System.double is type specific.

Simple as that. And yes they are both correct in this specific case.

As for the the members of the Grasshopper Core, you can find them in the GH SDK.

Best,

M.

I appreciate the help from both of you.

Cheers

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