Write file from VB. - Grasshopper2024-03-29T12:23:03Zhttps://www.grasshopper3d.com/forum/topics/write-file-from-vb?commentId=2985220%3AComment%3A704694&x=1&feed=yes&xn_auth=noIt would be nice to be able t…tag:www.grasshopper3d.com,2012-10-14:2985220:Comment:7046942012-10-14T10:40:20.890ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>It would be nice to be able to write multiple files (i.e. each branch in a datatree becomes its own file).</p>
<p></p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p>
<p>It would be nice to be able to write multiple files (i.e. each branch in a datatree becomes its own file).</p>
<p></p>
<p>--</p>
<p>David Rutten</p>
<p>david@mcneel.com</p>
<p>Poprad, Slovakia</p> Now that I think about it, I…tag:www.grasshopper3d.com,2012-10-14:2985220:Comment:7050172012-10-14T10:27:17.057ZChris Wilkinshttps://www.grasshopper3d.com/profile/ChrisWilkins
<p>Now that I think about it, I guess there really isn't a reason the Panel can't be used for this in all cases. No need for built in. </p>
<p>Now that I think about it, I guess there really isn't a reason the Panel can't be used for this in all cases. No need for built in. </p> No in-build component yet.
-…tag:www.grasshopper3d.com,2012-10-14:2985220:Comment:7045692012-10-14T06:20:56.437ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
<p>No in-build component yet.</p>
<p></p>
<p><span>--</span><br/><span>David Rutten</span><br/><span>david@mcneel.com</span><br/><span>Poprad, Slovakia</span></p>
<p>No in-build component yet.</p>
<p></p>
<p><span>--</span><br/><span>David Rutten</span><br/><span>david@mcneel.com</span><br/><span>Poprad, Slovakia</span></p> Has this gotten any easier si…tag:www.grasshopper3d.com,2012-10-13:2985220:Comment:7041882012-10-13T16:22:15.494ZChris Wilkinshttps://www.grasshopper3d.com/profile/ChrisWilkins
<p>Has this gotten any easier since this post from three years ago? Is there a built in component for writing files now, or a plug in that does it?</p>
<p>Thanks!</p>
<p>Has this gotten any easier since this post from three years ago? Is there a built in component for writing files now, or a plug in that does it?</p>
<p>Thanks!</p> If you find that the Panel St…tag:www.grasshopper3d.com,2009-10-16:2985220:Comment:249952009-10-16T04:24:14.946ZDavid Ruttenhttps://www.grasshopper3d.com/profile/DavidRutten
If you find that the Panel Streaming function isn't giving you what you need, the easiest way to write to a file is:<br />
<br />
System.IO.File.WriteAllLines()<br />
System.IO.File.WriteAllText()<br />
<br />
I recommend using a StringBuilder to create the file contents as opposed to updating a String all the time by appending small segments. Much less memory overhead.<br />
<br />
--<br />
David Rutten<br />
david@mcneel.com<br />
Seattle, WA
If you find that the Panel Streaming function isn't giving you what you need, the easiest way to write to a file is:<br />
<br />
System.IO.File.WriteAllLines()<br />
System.IO.File.WriteAllText()<br />
<br />
I recommend using a StringBuilder to create the file contents as opposed to updating a String all the time by appending small segments. Much less memory overhead.<br />
<br />
--<br />
David Rutten<br />
david@mcneel.com<br />
Seattle, WA I guess I could use the Funct…tag:www.grasshopper3d.com,2009-10-16:2985220:Comment:249882009-10-16T02:12:41.295ZChris Wilkinshttps://www.grasshopper3d.com/profile/ChrisWilkins
I guess I could use the Function component and concatenate all of my fields together and then stream it. Hey, I think that would work fine and easy.
I guess I could use the Function component and concatenate all of my fields together and then stream it. Hey, I think that would work fine and easy. Hi Andy,
I want to write seve…tag:www.grasshopper3d.com,2009-10-16:2985220:Comment:249862009-10-16T02:06:52.502ZChris Wilkinshttps://www.grasshopper3d.com/profile/ChrisWilkins
Hi Andy,<br />
I want to write several fields at once into the file, separated by commas.<br />
-Chris
Hi Andy,<br />
I want to write several fields at once into the file, separated by commas.<br />
-Chris Why don't you just stream the…tag:www.grasshopper3d.com,2009-10-16:2985220:Comment:249842009-10-16T02:05:05.981ZAndy Paynehttps://www.grasshopper3d.com/profile/AndyPayne
Why don't you just stream the contents from a Post-it Panel? You can save as a .csv or .txt very easily... and no VB required. If you're data is coming out of a VB component, just dump it into a Post-it panel and stream the contents as normal.<br />
HTH,<br />
Andy
Why don't you just stream the contents from a Post-it Panel? You can save as a .csv or .txt very easily... and no VB required. If you're data is coming out of a VB component, just dump it into a Post-it panel and stream the contents as normal.<br />
HTH,<br />
Andy