Grasshopper

algorithmic modeling for Rhino

Is it possible to sucessfully add a background thread process within the "solve instance" method  of a custom compnent such that it intearcts correctly with a down stream component/s?

 

I have a huge text file that i wish to process in the background such that GH doesnt hang and the user can still interact with the canvas. I am able to successfully do this but the porblem is that when I try to force the component to re-read the file, one thread exits the component "solve instance" before processing of the file is complete. This means that any connected downstream component reads the output parameter of the component processing the file before it has been assigned a value. This stops recalculation of this downstream component and the component is constantly set to blank as its input parameter has inherited the initial upstream null value.

 

How can i stop this down stream component from beginning to inherit data form the upstream component until its backgorund thread has finished and data has been sent to the output prameter. I've tried using the Lock method on the compoent to disable and reenable the component but that doesnt appear to work. Do I need to use events? Im not an expert on event handling and i find teh whole thing a bit abstract for me to handle,

 

thanks

 

 

Views: 1076

Replies to This Discussion

I'm confused. I agree a solution has to be run to do this. I guess I got carried away after struggling to get it to work for ages now :/

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service