<Code Lib>
👍 0 👁 2

Cycle Theme

by @bimgineer · Jul 10, 2026
Tags

Description

Cycles Revit through four theme presets: matched Light/Dark UI and canvas combos, plus mixed pairs

Code

pyRevit
# -*- coding: utf-8 -*-
__title__ = 'Cycle\nTheme'
__author__ = 'bimgineer'
__min_revit_ver__ = 2024
__doc__ = 'Cycle Revit UI theme and canvas color scheme through preset combinations.'

from Autodesk.Revit.UI import UIThemeManager, UITheme

pairs = [
    (UITheme.Light, UITheme.Light),
    (UITheme.Dark, UITheme.Dark),
    (UITheme.Dark, UITheme.Light),
    (UITheme.Light, UITheme.Dark),
]

current = (UIThemeManager.CurrentTheme, UIThemeManager.CurrentCanvasTheme)
next_pair = pairs[(pairs.index(current) + 1) % 4] if current in pairs else pairs[0]

UIThemeManager.CurrentTheme, UIThemeManager.CurrentCanvasTheme = next_pair
guest@rvtdocs: ~/discuss

Want to join the conversation?

rvtdocs auth

Share & save code Comment on pages Save bookmarks Upvote snippets Gamification

Loading…