Grasshopper

algorithmic modeling for Rhino

How to get all branches to have same number of leaves

I have a tree that has different number of leaves per branch, say it varies from 3 to 5 leaves per branch. I want to export the data to excel such that each branch is assigned to a row and element 1 for each branch goes to col 1, element 2 to col 2 and so on. The issue I am having is how to deal with branches that have less than 5 elements. Notice how in the attachment the number 8 is at row 2 where I want it to be in row 3.

Views: 854

Attachments:

Replies to This Discussion

Hello

if you don't want to change data structure inserting nulls ( or other specified data) to the branches with less than 5 items could be a solution.

cheers

alex

edit* that is if they get successfully exported to excel

I wasn't sure if that would work (or how to do it everywhere) so I manually tried it and it didn't work. You can see my attempt in the attachment.

Hello Jon,

it seems that nulls (or even non-existing items) are inserted properly, you just have to flatten your tree before plugging it to the column input (and in your case don't [clean tree]).

You can also do it like this:

 

thanks that seemed to work. Do you know how to increase the number of columns in the excelwrite or do you just have to add another excelwrite?

This seems to be the only way I am afraid (link)

This is how I have done it in the past to get all tree's the same Length when using ghowl excel writer component.

 

Thanks. That also is a good idea.

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