Skip to content

[Request] Reveal a material in the Materials browser (In Model) from Ruby #1121

Open

Description

@maleko

Product

SketchUp

API

Ruby API

Use Case

An extension adds a material to the model (for example from a product library) and then offers the user a "Locate material" action, so they can find the new swatch in SketchUp's Materials browser.

Today the extension does this:

model = Sketchup.active_model
model.materials.current = material
UI.show_inspector('Materials')

The Materials inspector opens and its preview shows the material. But the browser list stays on whatever collection the user last viewed — for example the "Materials" library folders (Asphalt, Brick, Fabric, Glass). The new swatch is not visible or highlighted in the list, so the user still has to click the In Model (house) button and look for it by hand. Observed on SketchUp 2025 (macOS).

As far as we can tell, the Ruby API has no way to do this today:

  • UI.show_inspector only opens the inspector by name.
  • Sketchup::Materials#current= updates the preview, but not the browser's collection or selection.
  • No Sketchup.send_action action selects the In Model collection (and send_action is deprecated as of 2026.2).

Proposed Implementation

Either of these would cover the use case:

  1. An option on UI.show_inspector, for example UI.show_inspector('Materials', collection: :model), that opens the Materials inspector on the In Model collection.
  2. A method that reveals a material, for example Sketchup::Materials#reveal(material) (or Sketchup::Material#reveal), that switches the browser to In Model and selects and scrolls to that material.

Returning true / false would let an extension tell the user when the host could not do it.

Additional Context

Activity

  1. DanRathbun commented on Oct 23, 2026

    @DanRathbun

    We also have the added complexity that materials and collections (folder names) can be language localized.

  2. Eneroth3 commented on Oct 23, 2026

    @Eneroth3

    Maybe a more narrow and precise method only for showing In Model and scrolling to the selected material actually makes more sense than a generic way to navigate Materials 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions