generative modeling for Rhino
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?
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")
Hope that helps someone else in the future!
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.
Victor Leung's TextWriter worked great for what i needed...
This thread was helpful
Sorry for slow reply. Please see attached the full component script which will hopefully fill in the blanks.
Thanks for sharing the screenshot... it does really help fill in the blanks. I am starting to get the hang of it.