Toogle Dialogs via Ruby?
-
Can one activate the command Toogle Dialogs with Ruby? More specifically, can one turn on/off?
-
The only one I know of is:
Sketchup.send_action 21926
-
Ok - that's toggle. Thanks. And is there any way to know if they are hidden or not?
-
Do those send actions work on Macs?
-
@thomthom said:
Ok - that's toggle.
aka (Menu) Windows > Show / Hide Dialogs
@thomthom said:
... And is there any way to know if they are hidden or not?
You CAN get whether the USER has each one set to be shown or hidden thru the registry.
Ex:
Sketchup.read_default('SnappyComponents','show',0)==1 ? true : false
and also whether it's RolledUp or not
Sketchup.read_default('SnappyComponents','Minimized',0)==1 ? true : false
EDIT: Nevermind read_default (doesn't work) use the standard Ruby Registry module. Seems Sketchup.read_default cannot handle (or does not return by design,) DWord values in the Registry.
EDIT2: Fixed: the 'show' attributes are all downcase.IF attribute 'Show' is 0, the dialog is hidden no matter what the (global) "Show/Hide Dialogs" toggle setting is.
IF the dialog is 'rolled-up', AND shown (on screen) it's 'Minimized' attribute is 1 AND 'show' is 1.
When you close the 'Minimized' dialog, it's attributes are 'Minimized'=1 and 'show'=0.
When a closed 'Minimized' dialog is re-shown (Same session, or new session,) the 'Minimized' attribute is changed to 0 because Sketchup auto-unrolls it, and the 'show' attribute = 1.But I cannot find a way to know (cross-platform) whether the (Show/Hide Dialogs) Menu item is checked or not. Of course we can do it using Win32API call. When the dialogs are globally Hidden their 'Show' registry attributes remain unchanged, and the Show/Hide toggle is reset (all dialogs are shown per registry settings,) when you reopen Sketchup.
Advertisement