I’m looking for a way to universally toggle (preferably with a shortcut key) the current state of visible all trays off & back on (hide & unhide).
I use multiple trays and even with 2 screens (SketchUp open on one screen & the trays on the other) they take up a lot of my available screen real estate keeping me from viewing anything else in the OS when SketchUp is the application in focus.
Hey y’all yes I was already doing both of those things but thanks the suggestions. If I could create a shortcut key that toggled them all off or on that would be awesome - Photoshop has this capability and it’s greatness!
The SketchUp Ruby API does not expose anything specific to the tray system.
But (on Windows editions) we can use automation IDs if we know them.
On my machine their command IDs are sequentially numbered beginning 10640 (for the Default tray.)
I do not use the Default Tray myself, only 6 other custom named trays.
(I do not rename the Default tray even though it is possible, it causes a bug.)
So if I were to write a command for myself it’d be …
UI.menu("Window").add_item("Toggle ALL Trays") {
for t in 1..6
Sketchup.send_action(10640+t)
end
}
This puts a menu item in the Window menu that can be assigned a single shortcut (key or combination.)
Tested and there are some interesting behaviors.
Two of my trays are collapsed into the left margin, … HELP (with the Instructor panel,) and TREE (with the Outliner panel.)
When they are collapsed their toggle does not do anything.
For the other 4 that are stacked in a docked pane on the right, the one that is active after toggling back on, is the one highest in number (regardless of which one was active when they were toggled off.)
I do not want this, I want my #3 tray PROPERTIES (with the Entity Info panel) to be the active tray after toggling back on.
So for me I’d likely just list the IDs in the order I wished them to toggle off and back on.
Which is …
UI.menu("Window").add_item("Toggle ALL Trays") {
6.downto(3) do |t|
Sketchup.send_action(10640+t)
end
}
This is a 7 year old topic, back when all the windows were MFC objects.
I had not tested this since the Windows edition migrated to using the Qt GUI framework,
It would seem that the old automation IDs are no longer valid.
Thank you. I’ve updated my profile.
This autohotkey script works instead, assigning sketchup shortcut key CTRL+SHIFT+ALT+# (# for each tray) to toggle tray visibility, in my case trays 1-4