How can I make a unique component source file link for a custom tray?

Hello all
I want to create a custom tray which will just be for selecting a specific folder of components to use within Sketchup. But I also want to be able to access my main (different) component folder from the main tray.
I know how to change the source folder using window/preferences/files but I can’t see how it’s possible to have a different source folder for a different tray.
Can anyone advise how to do this?

Currently, there is no API exposure for either trays or inspector panels.

This is doable now manually. The Components inspector panel allows the user to open a secondary selection pane.

Click the expand pane button at the top right of the inspector panel (orange arrow points at it in screen clip below.)


For your custom components subfolder, copy their files to a subfolder of the User %AppData% “Components” folder. (It is important that ALL custom component files be placed in subfolders as the folder names will be used as the collection name in the dropdown picklists.)

Once your custom subfolder is there, SketchUp will automatically enumerate this folder and it can be accessed by the folder selection dropdown list in either of the Components inspector panel’s selection panes. (You might need to either close and reopen the inspector panel or restart SketchUp for the new folder to show up.)

To easily open your custom user “Components” folder location, within SketchUp open the Window > Preferences dialog and switch to the Files panel. Click the folder button to the far right of the Components path.

If you are writing an extension for distribution, it is best if your extension (upon first use) creates a subfolder under the user’s Components folder and copies the needed component files from a distro subfolder beneath the extension’s own subfolder. (This is similar to what SketchUp itself does for the Trimble extensions that are distributed with SketchUp.)

If you need to copy files using Ruby, see the Ruby Core classes:

1 Like

Thanks a lot for that Dan, really useful information.
Ideally I need to make a separate directory for the additional tray so I think I may need to create a bespoke pop up window for that so will have a read up on the Ruby Script and give it a go…

We have some examples on creating HtmlDialogs:

Thanks for the info and resources.
Can anyone advise on where is a good place to find and employ a developer to assist me with the coding and also to learn from?

You can advertise in the Commercial and Collaborative Work - SketchUp Community category.

But a forum and Private Messaging is not a good means to teach programming.

Before you spend a lot of time, effort and money, I would suggest you at least try the native feature using the secondary selection pane as I explained above. (This is also explained in the online Help.)