Quick Links - Also see the menu above and more choices on the right side of the blog (too much, but all good stuff)

\/ ...and now BIMbuilder.com Blog Posts... \/

Thursday, April 8, 2010

Revit 2011 Custom Ribbon Tab

Anyone this far advanced in Revit yet? I'm looking for a Revit API programmer with 5 years experience of API programming. Does that exist?

Partial Repost: http://redbolts.com/blog/post.aspx?id=8daddb86-5fad-4cf1-9439-732b941ce839

At the beginning of the year I showed you how to add your own tab to the Revit Ribbon. I’ve updated this now for Revit 2011. However, I’ve taken the chainsaw to my code for 2 reasons. The API wasn’t very elegant and the 2011 ribbon seems to behave itself a lot more than the ribbon in Revit 2010. So there is no need to manage context switching as in Revit 2010. Having said this, if anyone finds this new code isn’t behaving please let me know ;-)

The code is now implemented as an extension method to the UIControlledApplication . This means as long as you reference the extension method namespace correctly you should see this in intellisense when creating a custom tab:


And when creating a panel there are 2 additional overloads:


So in summary to add a custom tab use the following :

public Result OnStartup(UIControlledApplication application)
var tab = application.CreateRibbonTab("MyTab");

And to add a panel to the custom tab there are 2 overloads. The first where you pass the tab instance:

var tab = application.CreateRibbonTab("MyTab");
var panel = application.CreateRibbonPanel(tab, "Test Panel");

And the second where you name the tab

var panel = application.CreateRibbonPanel("MyTab", "Test Panel");

Read More of this Post>>Revit 2011 Custom Ribbon Tab


  © Blogger template ProBlogger Template by Ourblogtemplates.com 2008

Back to TOP  

[Valid Atom 1.0]