Hi all,
I’m building a custom WPF tool inside my plugin that needs to preview Rhino command icons , matching whichever icon Rhino itself would show in the current light/dark theme.
So far I’ve confirmed:
Rhino.Runtime.HostUtils.RunningInDarkMode, tells me which mode is active.RhinoApp.AppSettingsChanged— fires when the theme is toggled live, so I can refresh my own icons in sync with Rhino’s UI.- The Button Editor / SVG Editor in Rhino 8 supports per-button light and dark SVG pairs (with “recolor light image for dark modes” / “force light image” options), so Rhino clearly already has both variants available internally for stock toolbar buttons.
What I haven’t found is a supported way to read those icons back out through RhinoCommon. Rhino.UI.ToolbarFile, Rhino.UI.ToolbarGroup, and Rhino.UI.Toolbar let me enumerate loaded .rui files, but Toolbar only exposes things like Name, Id, and BitmapSize — there’s no public way to enumerate individual buttons/macros and pull their bitmap or SVG data (themed or otherwise).
This isn’t just about stock Rhino commands either. My picker needs to reflect whatever’s actually loaded in the user’s session at runtime:
- Built-in Rhino command icons
- Icons from third-party/installed plugins (each shipping their own
.ruiwith their own light/dark button art) - Custom buttons end users have created or edited themselves (macros built in the Button Editor, possibly with no backing
Commandclass at all , just a script/macro string and a hand-picked icon)
So ideally I’m after something more general than a single-command lookup: a way to enumerate all currently loaded toolbar buttons across every .rui source (stock, plugin, user), and get each one’s current icon for the active theme , not just look up one known command by name.
Questions:
- Is there an undocumented/internal API for enumerating loaded toolbar buttons (stock, plugin, and user-customized) and fetching each one’s icon (light + dark variant) that I’m missing?
- If not, is this something that could be exposed in RhinoCommon , e.g. a way to walk
Toolbaritems and call something likeToolbarButton.GetIcon(bool darkMode), for plugin UIs that want to mirror the user’s actual current toolbar/button set rather than just a fixed list of stock commands?
Thanks