# Programatically hide/restore the default tray from the API

**URL:** <https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559>\
**Category:** Ruby API\
**Created:** [July 19, 2021, 1:00pm UTC](https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559 "2021-07-19T13:00:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlosM](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@carlosM](https://forums.sketchup.com/u/carlosM)\
**Post date:** [July 19, 2021, 1:00pm UTC](https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559/1 "2021-07-19T13:00:14Z")

</div>

Hello,

is it possible to hide/restore the default tray programatically from the sketchup ruby API?

I notice when some of the trays are open the performance of some of the operations in my plugin dramatically fall. I could warn my users about this issue (so they could hide it manually), but It would be great if I could simply hide it programatically before those procedures take place and then restore it.

regards, Carlos

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [July 19, 2021, 1:06pm UTC](https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559/2 "2021-07-19T13:06:56Z")

</div>

Unfortunately it is not really possible. You can show, but can not hide them…See:

[How to make a simple Tray or roullOut in the sketchup? - Developers / Ruby API - SketchUp Community](https://forums.sketchup.com/t/how-to-make-a-simple-tray-or-roullout-in-the-sketchup/130298)

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [July 19, 2021, 1:21pm UTC](https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559/3 "2021-07-19T13:21:28Z")

</div>

BTW:  
The [Sketchup::Model#start\_operation](https://ruby.sketchup.com/Sketchup/Model.html#start_operation-instance_method) have an ability to disable UI updates… (it could help in good part of the cases)

---

<div class="post-metadata">

**Author:** ![carlosM](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@carlosM](https://forums.sketchup.com/u/carlosM)\
**Post date:** [July 20, 2021, 6:05am UTC](https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559/4 "2021-07-20T06:05:41Z")

</div>

Hi dezmo,

Thanks for the answer!, I will try disabling UI updates, that might solve my issue.

Other solution could be to prevent the user with a warning message to hide the default tray before launching the operations, is there a way to programatically detect if the default tray is hidden or shown?

regards, Carlos

---

<div class="post-metadata">

**Author:** ![dezmo](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/dezmo/32/51058_2.png) [@dezmo](https://forums.sketchup.com/u/dezmo)\
**Post date:** [July 20, 2021, 6:28am UTC](https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559/5 "2021-07-20T06:28:58Z")

</div>

> [@carlosM](#):
>
> is there a way to programatically detect if the default tray is hidden or shown?

No. ☹

(See e.g. here: [https://forums.sketchup.com/t/inspector-visibility-determine-whether-a-given-inspector-is-visible/151361](https://forums.sketchup.com/t/inspector-visibility-determine-whether-a-given-inspector-is-visible/151361) )

---

<div class="post-metadata">

**Author:** ![carlosM](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@carlosM](https://forums.sketchup.com/u/carlosM)\
**Post date:** [July 20, 2021, 6:38am UTC](https://forums.sketchup.com/t/programatically-hide-restore-the-default-tray-from-the-api/170559/6 "2021-07-20T06:38:01Z")

</div>

Thanks dezmo,

anyway disabling UI updates seems to work pretty well :). so it is even better this way

regards, Carlos
