Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66842

Re: How to check the exisiting of ribbon tab and ribbon panel? And how to get th

$
0
0

This works for me

            string tabName = "TabName";
            string panelName = "PanelName";
            try
            {
                a.CreateRibbonTab(tabName);
            }
            catch { }
            List<RibbonPanel> panelList = a.GetRibbonPanels(tabName);
            RibbonPanel panel = null;
            foreach (RibbonPanel rp in panelList)
            {
                if (rp.Name == panelName)
                {
                    panel = rp;
                    break;
                }
            }
            if (panel == null)
            {
                panel = a.CreateRibbonPanel(tabName, panelName);
            }

a.CreateRibbonPanel(tabName, panelName);
}


Viewing all articles
Browse latest Browse all 66842

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>