Rhino.WriteTextFile can no longer create a file?

If yes, was R5 bugged all that time? It was a good bug… RIP.

Hi @Asterisk,

This seems to work:

Sub Main
	Dim strFile, arrStrings(4)
	arrStrings(0) = "Every"
	arrStrings(1) = "good"
	arrStrings(2) = "boy"
	arrStrings(3) = "deserves"
	arrStrings(4) = "fudge."
	strFile = Rhino.SaveFileName("Save", "Text Files (*.txt)|*.txt||")
	If Not IsNull(strFile) Then
		Call Rhino.WriteTextFile(strFile, arrStrings)
	End If
End Sub

Make sure you are saving to a folder that you have rights to save into.

– Dale

This fails in R6. Works in R5.

Sub Main
Dim arrStrings(4)
arrStrings(0) = “Every”
arrStrings(1) = “good”
arrStrings(2) = “boy”
arrStrings(3) = “deserves”
arrStrings(4) = “fudge.”

Rhino.WriteTextFile "test.txt", arrStrings

End Sub

Not an issue as I just switched all those lines to VB

What folder is this writing to? If you’re not sure, then that’s a problem…

– Dale

R5 has it written into Rhino.WorkingFolder which is the folder I’m opening my 3dm from which in this case is my desktop.

This function has not changed between V5 and V6.

You should always specify the full path to the file you are writing.

– Dale

Just saying that I didn’t have to in R5.