Grasshopper

algorithmic modeling for Rhino

Python Script Component not outputting all values from loop

Having some trouble here with getting all the data out of my python component. Instead of all points getting output to rhino I'm only getting the first one. What am I doing wrong with my code?

Views: 387

Attachments:

Replies to This Discussion

Because you are changing the value of your variable every time in the loop. You should use a list.

for example for each variable you output, you should create a list before the loop and then append to that list in your loop.

Example:

date = []

lat = []

for line in lines:

date.append(ptInfo[0])

lat.append(ptInfo[1])

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