Command to refresh layer list (F5)


#1

I use files of commands like this

setredrawoff
create some layers
make some objects
setredrawon

After they run, the layers exist but aren’t shown in the layer manager until F5 is pressed to refresh it. I’d like to add a command to do that into the file. Is there any command that either causes a refresh of the layer manager, or simulates pressing F5?

(Alternatively, could we get the buglet fixed? Setredrawon should refresh the layer manager if layer states were changed.)

As far as I can tell, no command available through -layer causes a refresh. Changing the order of layers does do it, but as far as I know there’s no command-line way to do that.

(Please either answer the question or don’t answer it, rather than advise me to move the layer-creating commands outside the setredrawon/off block. I actually did already think of that. In the particular case I have in front of me it’s very difficult, for reasons which you would find very boring if I described them. Thanks.)

Thanks,
Bathsheba


#2

Hi Bathsheba,
Nice to see you in here!
As a crude hack, you might try this:
Grab the attached script file, put it somewhere like your scripts folder, and then from there drag and drop it into a running Rhino instance (only 1 Rhino open). That will create an alias “RedrawScreen” which you can insert at the end of the macro which will force a screen redraw and (hopefully) refresh your layer box.

setredrawoff
create some layers
make some objects
setredrawon
redrawscreen

But I agree, this needs to be fixed, I have seen this too with scripts I have that manipulate layers.
----H

RedrawScreen.rvb


#3

Currently we toggle the layer filters to refresh the layer list.

Dan


#4

Dan, I’m not seeing how to do that from the command line. Is there a way?

Thanks.


#5

Thanks Helvetosaur!! That works.

But yeah it should be fixed.


(Brian Gillespie) #6

Thanks Bathsheba,

This is now reported as http://mcneel.myjetbrains.com/youtrack/issue/RH-19680

(No, you can’t see those bugs yet, but soon I hope you will)


(Dale Fugier) #7

Hi Bathsheba,

The layer redraw issue that you see when you use SetRedrawOff/SetRedrawOn will be fixed for the next service release (hopefully). In the mean time, with your scirpt, just replace this:

_SetRedrawOn

With this:

_-RunScript ( Call Rhino.EnableRedraw(True) )

Doe this help?

– Dale


#8

@dale Cool, I didn’t know you could do that, thanks!
----H


#9

It is cool, however it does not cause the layer panel to refresh.


#10

What about

_-RunScript ( Call Rhino.Redraw() )

Does that do it? That should be the equivalent of what I posted previously, with the advantage that it doesn’t need to be stored somewhere as a script and aliased (assuming it works).
----H


(Dale Fugier) #11

Hi Bathsheba,

See if this works (or not):

_SetRedrawOff
_-Layer _New Curley,Larry,Moe,Shemp _Enter
_-RunScript ( Call Rhino.EnableRedraw(True) )

Does this help?


#12

That works. Thanks!


#13

OK, odd, SetRedrawOn normally should also refresh the screen, I guess that’s where the bug is… Anyway glad the workaround works.
----H