Turn Ribbons On & Off

michellem
Advocate

Turn Ribbons On & Off

michellem
Advocate
Advocate

Hello Everyone;

 

Is it possible to create a button that would list all available ribbons (built-in and add-ins) along with a checkbox to turn ribbons on or off?

I am thinking of something that would look like the User Interface pulldown:

michellem_0-1667238277776.png

Ideally, I would like it on the quick access toolbar.

 

Or maybe someone has already made something like this?

 

Any help, as always, is appreciated.

 

Michelle

0 Likes
Reply
Accepted solutions (3)
478 Views
4 Replies
Replies (4)

moturi.magati.george
Autodesk
Autodesk
Accepted solution

Hi @michellem,

 

Not sure if this is what you are looking for but Jeremmy's Blog actually talks about this. It will be interesting to see the thoughts of others too.

 

https://thebuildingcoder.typepad.com/blog/2013/07/dynamically-hide-and-display-a-ribbon-panel.html

  Moturi George,     Developer Advocacy and Support,  ADN Open

michellem
Advocate
Advocate

Hello Moturi;

 

Not quite... I believe a Ribbon Panel is the green clouded item and what I want to turn off (not visible) is the red clouded item. For built-in ribbon tabs, there is way via the Revit Options dialog.

michellem_0-1667328795581.png

 

From Jeremy's blog and other postings, I think the answer might lie in these two DLLs. However I can not find much info about them...

  • AdWindows.dll
  • UIFramework.dll

Does anyone have any info?

 

Sincerely;

Michelle

 

0 Likes

naveen.kumar.t
Autodesk Support
Autodesk Support
Accepted solution

Hi @michellem ,

 

Are you looking for this?

Autodesk.Windows.RibbonControl ribbon = Autodesk.Windows.ComponentManager.Ribbon;
foreach (Autodesk.Windows.RibbonTab tab in ribbon.Tabs)
  {
   if (tab.Title.Contains("Modify"))
    {                   
      tab.IsVisible = false;  
    }
 }

 

Before

Before.png

After

After.png


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

michellem
Advocate
Advocate
Accepted solution

Hello Naveen;

 

That is exactly what I was looking for. 

 

Here is a code snippet in Python:

 

clr.AddReference('AdWindows')
import Autodesk.Windows as adWin
ribbon = adWin.ComponentManager.Ribbon
for x in ribbon.Tabs:
  if x.Title.Contains ("JOTools"):
    x.IsVisible = True

 

Next task...Figure out if it is possible to get a drop down checkbox control into the Quick Access Toolbar.

Thanks much;
Michelle

 

0 Likes