ScriptEditor - No Redraw when script finishes if rs.EnableRedraw(False)

This was mentioned in another topic but I wanted to make sure it gets noticed:

Make a new blank file with just one “Default” layer, set layer color to black and draw a box.

Run the following in ScriptEditor:

import rhinoscriptsyntax as rs

Neither the box nor the layer color change. In fact, the whole scene is frozen, trying to zoom or pan does nothing, because Redraw has been set to off with rs.EnableRedraw(False) and the script ending does not reset it back to on. Of course there is no reason to call rs.EnableRedraw(False) in this simple case, but one could have it there for other reasons, or simply to prevent flashing if you are looping through a whole list of layers.

This does not happen in the EditPythonScript editor either in V7 or V8 because the redraw is automatically set to on when a script finishes.

One can certainly add


to the end of every script, but IMO this is a regression/bug that should be fixed.


1 Like

@Helvetosaur this is great. Thank you!

I made a ticket here and will get it fixed for next build

RH-77073 Perform a Redraw() after script ends in editor