Change Color of the Revit Ribbon with Dynamo

Hi everyone,

I’m preparing an april fool script for a few of my collegues that changes a few setting in the Revit UI.

Here’s a script that change the color of the panel (The change is temporary)

import clr

clr.AddReference('PresentationCore')
clr.AddReference('AdWindows')
import Autodesk.Windows as adWin
from System.Windows.Media import Colors, ColorConverter, SolidColorBrush

ribbon = adWin.ComponentManager.Ribbon

color_converted = ColorConverter.ConvertFromString("#00bfff")

NewPanelColor = SolidColorBrush(color_converted)

for tab in ribbon.Tabs:
	for panel in tab.Panels:
		panel.CustomPanelBackground = NewPanelColor

Hopefully, I won’t get fire for this haha :sweat_smile: :joy:

Have a great weekend!

Here’s all the link/documentation that helped me to do this :

BuildingCoder - Jeremy Tammik

Dynamo Script from Kibar and cgartland

Our Lord and Savior Stack Overflow

9 Likes

If you like this sort of stuff, @john_pierson 's rhythm package has a few goodies for you.

image
image

5 Likes

Thanks @Robert_Younger for sharing! Totally forgot @john_pierson have something for that haha.

However, I didn’t find something that changes the font police …

If you want something for that :

import clr

clr.AddReference('PresentationCore')
clr.AddReference('AdWindows')

import Autodesk.Windows as adWin
from System.Windows.Media import FontFamily

This_is_fun = adWin.ComponentManager.FontSettings

OUT = This_is_fun.ComponentFontFamily = FontFamily("Comic Sans MS")

This is fun1

9 Likes

Oh wow! I had not seen the font portions. Awesome!

3 Likes

Thanks for this thread @BenBimlogic :smiley:

I did not know about the Rhythm nodes and instantly built a graph to hide all unneccessary ribbons :slight_smile: That would be so much better if there was a way to set the order of the ribbons!

And for sure i will add those color and font codes to all of my scripts to surprise my coworkers some day :smiley:

1 Like

No problem! It’s a pleasure to share with the community!

Also, are you asking if it’s possible to move the tab in the order that you want ?

If yes, I don’t have a script for it but you can click on the tab and press the Ctrl button on your keyboard. You’ll be able to change the order :
Before
after

3 Likes

Happy April Fool’s Day!
DynamoScript - Office STD.dyn (15.2 KB)


:partying_face: :joy:

3 Likes