Minor issue: cannot close layerstatemanager panel via toggle command

Hi. I wanted to write a macro for my middlemouse button to toggle the layerstate manager… toggle doesnt seem to work…
!_-layerstatemanager _visible _toggle _enterend

Perhaps try
!_-layerstatemanager _visible _enterend

Can’t test right now, but it might work…

nope. guess it is a bug of some sorts.
workaround is a pascals universal toggle script:

import rhinoscriptsyntax as rs
import scriptcontext as sc

layestatestoggle = False
if sc.sticky.has_key(“X_TOGGLE”):
layestatestoggle = sc.sticky[“X_TOGGLE”]

if layestatestoggle:
rs.Command ("_-layerstatemanager _visible=yes Enterend")
if rs.LastCommandResult() == 0:
sc.sticky[“X_TOGGLE”] = False
rs.Command ("
-layerstatemanager _visible=no _Enterend")
if rs.LastCommandResult() == 0:
sc.sticky[“X_TOGGLE”] = True

Hi Anika - yeah, I see that - toggling on works, off not, here. Thanks.



1 Like