The attached python script displays an issue with the progressbar stalling.
It’s a dummy script where after about 33% the progressbar stops responding and only when the script finishes there is a redraw.
In V5 the progress bar runs fine until the end.
import Rhino
def DoThis():
sphere = Rhino.Geometry.Sphere(Rhino.Geometry.Point3d(0,0,0),50)
VMP = Rhino.Geometry.VolumeMassProperties.Compute(sphere.ToNurbsSurface())
def TestRun():
#Initialize progressmeter
count = 1000
label_string = '{} part breps are being prepared'.format(count)
Rhino.UI.StatusBar.HideProgressMeter()
Rhino.UI.StatusBar.ShowProgressMeter(0,count,label_string,True,True)
progress = Rhino.UI.StatusBar.UpdateProgressMeter
P = -1
for p in xrange(count):
P+= 1
progress(P,True)
DoThis()
Rhino.UI.StatusBar.HideProgressMeter()
TestRun()
Yes this prevents the stalling.
However, in V5 the stalling does not occur and it feels if such a Wait is needed,
the UpdateProgressMeter is not working as it should.
From my point of view it should be that calling an update on the ProgressMeter would not require me to initiate another wait.
Or am I spoiled thinking this should work regardless the Wait()
Well, Rhino 5 does the ‘Wait’ for you. Be we removed this from Rhino 6, as it isn’t always and, thus, could cause issues when called from another thread. So we wanted to make it the caller’s responsibility.