Grasshopper

algorithmic modeling for Rhino

Hi,

Is there a way to set the file name and location to which a panel streams its contents other than right clinking on the panel and setting it manually e.g. from another panel containing "C:\temp\output.txt"? In other words, is there a Write version of the Read File component or is there an easy way to create one through script?

Thanks

Mark

Views: 1321

Replies to This Discussion

Managed to answer my own question in the end and created an VB component using the FileStream writer:

      Dim FILE_NAME As System.IO.FileStream
      FILE_NAME = System.IO.File.Create("C:\temp.txt")

      Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
      

      objWriter.Write("Your panel contents read to here")
      objWriter.Close()
 

Hope that helps someone else in the future!

Mark

Dear Mark, Thanks for sharing your solution... I am a real beginner when it comes to creating VB components... I have been trying to insert the code you generously offered up... into a VB component, but I think I am missing something obvious.

I have been reading through some tutorials, but I haven't found my error yet.

Would you mind offering some advice?

Here is a screenshot of your code that I placed in a component, then attempted to use.

Thanks for any advice.

AB

Attachments:

Victor Leung's TextWriter worked great for what i needed...

This thread was helpful

http://www.grasshopper3d.com/forum/topics/suggestion-improve-text?x...

Hi

Sorry for slow reply. Please see attached the full component script which will hopefully fill in the blanks.

Mark

Attachments:

Mark,

Thanks for sharing the screenshot... it does really help fill in the blanks. I am starting to get the hang of it.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service