Grasshopper

algorithmic modeling for Rhino

Hi,

I am working on a UI (c# forms) which is able to control sliders and to start a new solution. I got it working on the main/ui thread. Now I would like to shift the work to a background thread to achieve that the UI is still responsible during a new solution. 

Therefor I find the c# backgroundWorker approach pretty smart. Unfortunately, I always get an error because my access on the GH_DocumentEditor seems to be from a different thread. 

Can anyone give me a hint what is mandatory to change slider values and start new solutions (like Doc.NewSolution(true)) out of the background thread?


Thanks in advance.

Cheers,

Daniel

Views: 332

Replies to This Discussion

UI is still responsible during a new solution. 

This probably won't work. Grasshopper solutions run on the UI thread, blocking all UI you care to throw on the screen. You can try calling GH_Document.NewSolution from a non-UI thread, but there's no telling what crashes you're inviting by doing that.

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