@eirannejad I was able to successfully hide/show tabs so we can clean them up after removing packages, which is a nice touch (uses tab name).
(especially since for some reason, buttons are not being disabled for deleted packages even after reloading)
It uses the AdWindows.dll assembly. I am not sure if anything needs to be changed on the RPL,
but on my end it's working out of the box. I added an exception handler just in case since I haven't tested it out.
def toggle_tab(package_name, state):
""" Needs AdWindows.dll"""
try:
clr.AddReference('AdWindows')
from Autodesk.Windows import ComponentManager
except Exception as errmsg:
logger.warning('Could not access required DLL to hide/show tabs.')
else:
ribbon = ComponentManager.Ribbon
for tab in ribbon.Tabs:
if tab.Title == package_name:
tab.IsVisible = state
@eirannejad I was able to successfully hide/show tabs so we can clean them up after removing packages, which is a nice touch (uses tab name). (especially since for some reason, buttons are not being disabled for deleted packages even after reloading)
It uses the AdWindows.dll assembly. I am not sure if anything needs to be changed on the RPL, but on my end it's working out of the box. I added an exception handler just in case since I haven't tested it out.
https://www.dropbox.com/s/hf702cq0b427bxi/2016-08-27%2016-43-25.mp4?dl=0
Any concerns?
Discussion: http://forums.autodesk.com/t5/revit-api/remove-or-hide-a-ribbon-tab/td-p/6043321