Grasshopper

algorithmic modeling for Rhino

Lately I've found myself jotting down and formatting notes in Grasshopper then exporting to a text file. (If this is strange to you, I understand completely.) So I've written a quick script making that workflow a bit easier. I know there are other codes out there, but I thought it might be interesting to share nonetheless.

There are some simple built-in safety protocols. It checks for an existing file path first then proceeds with the exporting process. If the specified file contains data the user is prompted with a warning, asking him/her to allow an overwrite or specify a new path.

It also works with CSV files. You will need GHPython.

You're welcome to download it here. Image of it in use below.

Best,
/SPM

EDIT 05/2016: The above file now includes the latest script with the additional functions (append, relative path, etc.).

Views: 9889

Comment

You need to be a member of Grasshopper to add comments!

Comment by Stephen Maher on May 27, 2016 at 7:30am

Hey, Nick. Sure thing; I just updated the file in the post. I hope it helps!
/SPM

Comment by Nick Devlin on May 27, 2016 at 7:15am

Hi Stephen, 

Is there a link to the updated version with the append function? I downloaded from the link in the original post but it includes the overwrite function instead? Many thanks - this looks like just what I need. 

regards

Nick

Comment by Stephen Maher on September 4, 2015 at 9:29am

Now with an 'append' option. Should have thought of that before.

/SPM

Comment by Stephen Maher on August 23, 2015 at 4:06pm

Christian,

That code is an adapted version of Giulio and Brian's (see discussion here), which is why I credit them in the script.

The code pings the GH Document, so if you're passing along a definition to someone who doesn't have a particular plugin the file uses, it will not display in the [Panel]. But the user will still be prompted with the "Unrecognized Objects" warning.

/SPM

Comment by Christian Schmidts on August 23, 2015 at 3:10pm

The component is a useful alternative to stream content option of the panel.

But I was even more excited component you have 'hidden' which shows you the plug ins used in a definition. That is really helpful if you hand out definitions to people!

Comment by Stephen Maher on August 21, 2015 at 5:33pm

Matt,

My thoughts exactly. I was looking for a more user-friendly way to export text. The script allows me to stream data in real time or not. Fits better with my workflow.

/SPM

P.S. Just finished a bit of code that prompts the user to choose a file upon setting "write" to "True." This cut the code a few lines and removes the '"file" input, but may not be desirable if the user is constantly overwriting the same file.

Comment by Matt Gaydon on August 21, 2015 at 5:10pm

Guessing you know when you write click on a panel you can click stream contents and set file path to stream to. Only down side is it will stream them in real time with the only way to stop the over ride is right click the panel and click the stream contents icon again to stop it.

P.s I like the idea of a boolean switch to stop and start writing. As means you can design things then break the stream and use the saved data for something else. Guess you can do it with Data Dam though that does not have a switch and must be done manually.

Comment by 筑梦NARUTO on August 21, 2015 at 6:00am

Thanks for sharing

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