Grasshopper

algorithmic modeling for Rhino

We have some GH code that we're calling using Rhinoscript. As part of this Rhinoscript we're also making a call to a C# interface. 

When the Rhinoscript starts up it should check to see if a directory exists, if it doesn't then the C# should be called and the Rhinoscript should wait until the C# code has executed successfully to continue running. 

How should I go about getting the Rhinoscript to "pause" and wait for the C# to run?

Thanks!

Matthew

Views: 861

Replies to This Discussion

Your C# code should not return control to the callee (RhinoScript in this case) until it's done with its job. Then RhinoScript doesn't have to jump through hoops.

--

David Rutten

david@mcneel.com

So then how do I lock the flow from the C# bit of the plug-in. As it stands it gets called then the RhinoScript just goes about its business like a train off rails.

How are you invoking the C# part?

--

David Rutten

david@mcneel.com

Rhino.Command

Is there a better way?

-Matthew

That should still not return until the C# plugin yields control back to the callee.

I think perhaps your C# plugin command class starts doing something on another thread and immediately returns control on the main thread. However without seeing that code I can't be sure.

--

David Rutten

david@mcneel.com

ps. judging from the flatness of this discussion you're having trouble using straight forward reply as well?

The issue is that we created a GUI that feeds some content to Grasshopper. Our GUI starts up but once it up the control sequence doesn't halt so our GH just runs independent of the C# results. 

Then you need to make sure that your command doesn't return befire your window is finished. Yiu can euther show the window as a modal form, or you can run a blank getter in the rhino command line which prevents the command from finishing until you want it to.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service