Python-Script "remaining calculation time" feedback possible?

Hi there!

I am currently developing a handfull of user components for the company I am working at. They are near finished but now other people get to use them I am getting feedback that it’s kind of annoying to not know if the calculation is proceeding and how fast it is.
Any ideas on how to display a frequently updated text while the component is still working?


Yeah, waiting in the dark is the worst… just like when waiting for make2D (hint hint McNeel) :wink:
What I usually do is calculate how many calculations are to be made, then convert that to % and use rs.Prompt() to show it on the commandline. There is also a progressbar command you can use, but I rarely use it. If there are many thousand fast calculations then you don’t want to update the prompt for each pass as it is slow, so then you need to add a counter and update for every 10 or 100 or so.

Here is a simplified version, start there and ask when you need it more advanced:

import rhinoscriptsyntax as rs


for i in range(nrCalculations):
    rs.Prompt("Calculation "+str(i)+" of "+str(nrCalculations))

In RH6, you will see a progress bar at the lower right hand corner :wink:

Thank you! That is exactly what I was looking for.

1 Like

Wow A step in the right direction!!
One wish though: Move the progressbar up to a visible area, the right half og Command bar, or even the Command bar background would be nice.
Also it hurries to 98% and then stands idle at 98% until it’s done. But it’s much faster now.
And if I minimize Rhino and maximize then the progressbar is gone.

And I would like to have the visible lines drawn in front of the hidden by default. (Rhino should pay attention to layer order…)

Jørgen, husk å holde kommentarer mht RH6 i Serengeti-gruppa ellers blir vi kastet ut alle sammen… :wink:

One more thing… how to do this out of a parallel loop? I imagine if I access the same “process” variable from multiple threads at the same time that might cause problems.

Works like a charm for my non-parallel stuff though

Hei, men hvem startet? :smile:

Det må nok ha vært ham som skrev hint, hint, ikke det? :innocent:

1 Like

I’m going to improve the timing estimates for Make2d. This should improve the progress bar speed.


Okay I tried to use the threading.interlocked methods but I must have gotten something wrong… If you happened to have a hint for me, that would be nice. (2.6 KB)