New Roadmaps, Dark Theme Possibility Looming

Happy New Year of the Rabbit, xīnnián hǎo, 新年好!

Happy New Year of the Rabbit!

The Spring Festival is coming up this weekend, starting on Sunday, January 22, celebrating the Chinese New Year and another Year of the Rabbit.

In the lunar calendar, 2023 is a Water Rabbit Year. The sign of the Rabbit is a symbol of longevity, peace, and prosperity in Chinese culture. 2023 is predicted to be a year of hope, especially after the long pandemic period. Wishing all of us lots of health, energy and happiness in the new year!

In this new year, the Revit development team has another topic to share with us:

Dark Theme Possibility Looming

We recently announced internal thoughts on possibly converting the internal representation of Revit element ids from 32 to 64 bit in a future release of Revit.

In a similar vein, here is another internal topic being pondered. Please note the important safe harbor statement concerning these thoughts:

Roadmaps are plans, not promises. We’re as excited as you to see new functionality make it into the products, but the development, releases, and timing of any features or functionality remains at our sole discretion. These updates should not be used to make purchasing decisions.

So, the possibility that I would like to present today concerns supporting the Dark Theme and how to handle it in a Revit add-in:

Dark Theme Switching

Setting the UI Active Theme will switch the appearance of the Ribbon between light grey and dark blue, with three options:

Light:

Dark theme – light

Dark:

Dark theme – dark

The UI Active Theme options can define other colour settings to override the default ones:

Dark theme

Dark Theme API

New properties and events may be added for dark theme support:

Dark Theme Icons

Here are samples of the default dark theme ribbon background and button colour settings:

Light ribbon background:

Dark theme – light ribbon background

Dark ribbon background:

Dark theme – light ribbon background

Light ribbon buttons:

Dark theme – light ribbon buttons

Dark ribbon buttons:

Dark theme – dark ribbon buttons

Code Example: Handling Themed Ribbon Icons

  1. internal class TestRibbon : IExternalApplication
  2. {
  3.   private PushButton m_ribbonBtn;
  4.   public Result OnStartup(UIControlledApplication application)
  5.   {
  6.     var ribbonPanel = application.CreateRibbonPanel("33900745-04F5-4CC2-9BAC-3230716E3A54", "Test");
  7.     var buttonData = new PushButtonData("Test", "Test", typeof(CmdEntry).Assembly.Location, typeof(CmdEntry).FullName);
  8.     buttonData.AvailabilityClassName = typeof(CmdEntry).FullName;
  9.     m_ribbonBtn = ribbonPanel.AddItem(buttonData) as PushButton;
  10.     updateImageByTheme();
  11.     application.ThemeChanged += ThemeChanged;
  12.     return Result.Succeeded;
  13.   }
  14.   private void setButtonImage(string pic, string largePic)
  15.   {
  16.     var assemblyLocation = typeof(TestRibbon).Assembly.Location;
  17.     var assemblyDirectory = Path.GetDirectoryName(assemblyLocation);
  18.     var imagePath = Path.Combine(assemblyDirectory, pic);
  19.     var largeImagePath = Path.Combine(assemblyDirectory, largePic);
  20.     if (File.Exists(imagePath))
  21.       m_ribbonBtn.Image = new System.Windows.Media.Imaging.BitmapImage(new Uri(imagePath));
  22.     if (File.Exists(largeImagePath))
  23.       m_ribbonBtn.LargeImage = new System.Windows.Media.Imaging.BitmapImage(new Uri(largeImagePath));
  24.   }
  25.   private void updateImageByTheme()
  26.   {
  27.     UITheme theme = UIThemeManager.CurrentTheme;
  28.     switch (theme)
  29.     {
  30.       case UITheme.Dark:
  31.         setButtonImage("dark.png", "darkLarge.png");
  32.         break;
  33.       case UITheme.Light:
  34.         setButtonImage("light.png", "lightLarge.png");
  35.         break;
  36.     }
  37.   }
  38.   private void ThemeChanged(object sender, Autodesk.Revit.UI.Events.ThemeChangedEventArgs e)
  39.   {
  40.     updateImageByTheme();
  41.   }
  42. }

Dark Theme Additional Notes

Please note that only the 1st level UI supports the dark theme option.

Autodesk Icon Guidelines Snapshot

Prompted by Luiz' and Gábor's comments below, I acquired and posted an up-to-date snapshot of the current state of the Autodesk icon guidelines including the images above:

Thank you for asking, Luiz and Gábor.

Autodesk AEC Public Roadmaps

For more exciting news on possible upcoming product enhancements, check out the Autodesk AEC Public Roadmaps with dozens of items in each of the sections: