Grasshopper

algorithmic modeling for Rhino

Is there any way to read multiple text files into Grasshopper automatically one at a time in succession?

Vern

Views: 3088

Replies to This Discussion

How big are they? Could you not just read in all the files and then appended them together into a long list of data?

They're really small text files, but appending them together wouldn't help. I want to be able to read
each file, say in an ordinary folder, one after another until all the files in that folder are read. Any suggestions?

Vern

Hi Vern,

definitely a VB/C#/Python job. How are the text files defined? Is it a folder and should all the files be loaded in alphabetical order, or in order of date, or do you already have a list of file paths?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Hi David,

   Okay. Yeah, they're just normal text files that are in a folder. They should be loaded in alphabetical order, one at a time. It would be ideal if I could just pick a folder, and then the files would be loaded into Grasshopper one at a time.

Thanks,

Vern

Exactly what do you mean by "one at a time"? I just want to be sure I understand what you're trying to accomplish.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

I want to feed the 'Read File Component' thats in the special parameters tab with individual files from a folder. If I have a folder with multiple files in it, I want them to be fed one at
a time (one after another) automatically into the 'Read File Component'.

Thanks,
Vern

But what does "one after another" mean? Do you want to read one file, then solve the network, then read the next file, solve again? Or do you just want a list of all the files in a specific directory so that [Read File] can handle them all?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

The last suggestion that you made is correct. I just want the [Read File] component to be able to get multiple files from a directory like say in a normal folder somewhere, and read each one individually in alphabetical order.

I guess there also should be a variable parameter to adjust the time interval between reading one file and the next file.

Thanks

Vern

Will this be a component that could be added in an upcoming version update?

Vern

I wrote a small VB component that finds all the files in a specific folder. Does this do what you need?

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

Hi David

I wonder what an attempt for your first suggestion (read file, solve, read next) would be?

Thanks,

Mat

This might be too simple for what you need, but if you animate the slider it will read in a different text file. You could hook this up to the LocalCode Export component to export out geometry each time a new file is read.

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