Grasshopper

algorithmic modeling for Rhino

I am calling up a program in dos from grasshopper. If it takes more than 10 seconds to return data to grasshopper, rhino throws me a "Server Busy" error panel and a "switch to" or "retry" option. If I give it enough time and press either option, everything runs fine. Is their a way in grasshopper or in a VB script to delay that "server busy" error window?

Views: 532

Replies to This Discussion

Generally what I've done when I've ran into that situation within a VB script is to put the "request" within a loop that has some sort of timer on it. So if I make a request and get nothing back, wait for x number of milliseconds, and try again. That has helped in most situations, but not all. I believe there's a way to suppress those dialog boxes all together, but I'm not sure if that's available for the program you're trying to access.
Thanks Damien, I have been away for a little but am back to grasshopper. I am not sure what the request loop looks like. It can take anywhere from 10 seconds to several minutes for the process I call up to return results. This is the way I am calling up the process and then reading back the data. How and where would you write such a request loop?

Dim path As String = (path & ".bat")
Dim proc As System.Diagnostics.Process = System.Diagnostics.Process.Start(path)
proc.WaitForExit()
proc.Close()

Dim path2 As String = (path & ".dat")
Dim FStream As New IO.FileStream(path_dat, IO.FileMode.Open)
Dim FReader As New IO.StreamReader(FStream)
Dim Line As String = FReader.ReadLine
Do Until IsNothing(Line)
....
Line = Freader.ReadLine
Loop
FReader.Close()

Jeff
Here's specifically what I'm talking about. Its for accessing Rhino 4 through COM, but should be somewhat applicable in this case. If this doesn't work, then I would post on the Rhino Plug-ins newsgroup. Dale Fugier would probably be able to shed more light on how to suppress that dialog box.

http://en.wiki.mcneel.com/default.aspx/McNeel/Rhino4Automation

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service