Grasshopper

algorithmic modeling for Rhino

Hi, I got an issue with text file export.

The attached code is to simply export X, Y and Z coordinates of points into a CSV format.

I'm using StreamWriters since there is a bunch of points to export.

The attached code works fine actually, but when it finished writing a file, the Grasshopper turns incapable of dragging the canvas. Zooming works.

This can be fixed by clicking the boolean button again, and close the SaveFileDialog without saving anything. By doing this, I can get back the control over the canvas.

So what's wrong should be somewhere in the if(savefile.ShowDialog() == DialogResult.OK){} section. I cannot identify what it is. I tried adding sw2.Close() in the end, but nothing has changed.

Is anybody available to advise me what's wrong with this code?

Thank you.

Views: 886

Replies to This Discussion

I know this is not realy a fix, but try using a boolen toogle instead of a button.

another thing that could help is

http://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_RhinoApp_...

Bingo, RhinoApp.Wait() worked! Thank you!

It should be exactly here. Nowhere else worked.

No, sometimes it works, but sometimes doesn't.

So simply, we should use Boolean toggle, not a button.

Why I didn't like Boolean toggle is that sometimes I leave it on, save the document and close. After that, when I open the document the CSV writer runs. When it happens, it's hard to identify which Boolean toggle is kept on.

Hi Miki,

I have same topic here,

So far the script works well, but I'm not sure if you want the same result with what I did.
You can check the definition below.

Attachments:

RSS

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