Grasshopper

algorithmic modeling for Rhino

the "s" is list data containing 1 branch and 100 datas.If the "y" is 2, i wanna "a" is 50 branches and every branch contains 2 data. As the same ,if "y" is 5, the "a" is 20 branches and every branch cotains 5 data. if the "y" is 3, the a is  34 branch ,the branch in 1 to 33,contains 3 data,and the 34th branch contains 1 data..  i dont know how to write the python code.

Views: 271

Replies to This Discussion

try this code in C# Component. :)

for type Hint assign x = list/System Object, y = item/integer

    DataTree<object> treeA = new DataTree<object>();

    for(int i = 0; i < x.Count ; i++){

      treeA.Add(i, new GH_Path(i / y));
    }
    A = treeA;

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service