Ribbon Tabs - Get Name and "ID"

Hello Dynamo Friends :slight_smile:

I want to get all Tabs, their names and their “ID”.

With ID i mean something only Datashapes UI can give me currently:

Datashapes:
image

Because some Tabs have the same name i have to get this additional name somehow.

Would like to build my own python code, so here is my start, but not working :smiley:

RvtRibbonPanel has no attribute GetName

import clr
clr.AddReference('PresentationCore')
clr.AddReference('AdWindows')
import Autodesk.Windows as adWin

ribbon = adWin.ComponentManager.Ribbon

for tab in ribbon.Tabs:
	for panel in tab.Panels:
		x = panel.GetName
	
out = x

And here the API Class:

So what am I doing wrong?

Happy about any advice :slight_smile:

For Tabs, it doesn’t work if you try to get the name and id directly? Something like:

for tab in ribbon.Tabs:
	name = tab.Name
	# or
	# name = tab.AutomationName
	tab_id = tab.Id
1 Like

Hello @EdsonMatt :slight_smile:

Amazing, that works :smiley: Thank you!

import clr
clr.AddReference('PresentationCore')
clr.AddReference('AdWindows')
import Autodesk.Windows as adWin

ribbon = adWin.ComponentManager.Ribbon
names=[]
Ids=[]

for tab in ribbon.Tabs:
		name = tab.AutomationName
		Id = tab.Id
		names.append(name)
		Ids.append(Id)
OUT = names, Ids
1 Like

So i can also check if the tab is visible and there are many other members for tabs.
But i can´t get setting the visibility to work, any idea about that?

Tryed to SetVisible(true), Visible(true), and so on without success.

Try this:

for tab in ribbon.Tabs:
	if tab.Id == "Architecture":
		tab.IsVisible = False
1 Like

Perfect, that makes my graph complete :slight_smile:
Thanks again Edson :slight_smile:

Tabs = IN[0]
Bool = IN[1]

for tab in Tabs:
	tab.IsVisible = Bool
OUT = Tabs

1 Like