Grasshopper

algorithmic modeling for Rhino

Any idea how can i export points as a .csv file from grasshopper,python component!!!! . . .

Thanks,

Views: 648

Reply to This

Replies to This Discussion

Salam... Something like this should do it:

Attachments:

Mersi mard,

It's working. thanks a lot.

There is also a build-in library in Python for that:

http://docs.python.org/2/library/csv.html

the CVS build-in Library doesnt work for IronPython wich is the version of python that run under Rhino 5 

True. Has anyone found a workaround in python for this? I'm trying to read a file line by line, essentially look up a line in a file by its line number.

is it a csv file? I haven't tested the code but something like this should work for you:

filename = open(yourFileAddress, 'r')

for lineNumber, line in enumerate(filename): 

          print lineNumeber #print the line number

          print line.split(',')  #print the line

filename.close()

Classic.

RSS

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2014   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service