Grasshopper

algorithmic modeling for Rhino

Hello,

I have a question about adding numbers at the first and last position of a datatree (python script).

I have a list with a certain amount of values (3 in this example) and a datatree containing the same amount of lists.

Now I want to add the first number in the list at the first and last position in the first list of the datatree.

The second number from the list I want to add at the first and last position in the second list of the datatree

The third number from the list to add at the first and last position in the third list of the datatree,

etc.

Appending%20numbers%20to%20datatree.jpg

expected%20result.jpg

Here I have a image of the list and the datatree and the expected result I want to have. Does anybody has a solution on how to write this in python script?

Thanks in advance

Views: 199

Replies to This Discussion

So why you dont you put these items when looping?

first time you enumerate just add first item two times, and last iteration add additionally first item.

Sorry I dont quite follow, i'm not such a python pro unfortunally.

Here I have a small example but I dont know how to write it in python

Attachments:

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