Grasshopper

algorithmic modeling for Rhino

Hi guys.

Is it possible to get "live updates" from the Python script? 

It is for when I have scripts that take a while, running a lot of loops, it would be great to be able add print commands that tells how far the script is and what it is script is doing?

I mean something similar to the "iteration" output from Daniel Pikers Kangaroo? That live updates.

I know this has a timer attached and that might the key, if so does anybody have an example?

In contrary to Kangaroo, I do not want the script to keep running, just "tell" me where it is and that it is still running?

I know its a little bit silly, but it would be nice. :)

Cheers Rasmus

Views: 1296

Replies to This Discussion

It sounds like what you what is actually not really like Kangaroo, which basically outputs the amount of iterations and the resulting geometry each time a step in the system has been solved. This can be implemented in GHPython using the sticky instead of using static variables like one would do in C# or VB. I have put up an example of how to approach this for the ShapeOp library here. The function of interest is the one called runSoSolverLive().

It sounds more like you want  to output a message from within a loop/process as it is running? If so, this could be solved by outputting a message directly to Rhino from within the loop (see attached). Highly untested so be careful :) 

Attachments:

Ah yes of course... making Rhino print is the way to go for this.

It would be cool though to see it happen visibly in Grasshopper as well, so I'll look into your first example at a later time.

For now the second example is great. I'm sure my project manager doesn't really care where I look :)  

Thanks a lot Anders - I promise to make it print some kind of Duke Nukem quote at the end...

Well clearly! Also, have it send you a mail once it's done. That will surely impress any manager :)

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