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, December 24, 2009

The Building Coder: Custom Ribbon Tab

Here's a little more about the Ribbon customization. You'll want to go directly to the source link to read the entire post.

Source: http://thebuildingcoder.typepad.com/blog/2009/12/custom-ribbon-tab.html
Jeremy Tammik 12/16/09

I am still on tour presenting at the Western European DevDays conferences, and with no time for blogging or responding to comments. In fact, I have almost no time for anything at all except presenting, meeting and discussing with participants during the day, and getting from one city to the next in the evenings. Right now I am sitting in the airport waiting for a plain to Milano. Back to Bella Italia, albeit for less than twenty-four hours.

I was hoping to find time to prepare a few blog posts in advance for the coming weeks, when I will be gone on holidays and vacation. Friday is supposed to be my last working day this year, and I am starting to wonder whether I will be able to just walk away from all the unresolved issues and leave them to lie until next year.

Anyway, in a sleepless hour in between I noticed that Augusto Gonçalves responded once again to a question that has already come up a few times in the past, so his interesting result is well worth while presenting, even if it is not directly useful in the context of the Revit API. It deals with the frequent question on whether it is possible to add your own ribbon tab to the Revit user interface.

Question: I expect the answer to this is no, but I thought I would at least ask anyway. Is it possible to create a new ribbon tab in Revit, similar to AutoCAD 2010, or are panels within the Add-Ins tab and items within those panels the only ribbon objects that can be accessed and created from a Revit add-in?

Answer: There is no documented support for this in the Revit API that I am aware of. There are however a couple of undocumented and unsupported .NET assemblies that can be used to access the Revit ribbon in an unsupported way. The functionality they provide can even be used to add your own custom panel to the Revit ribbon. What you cannot do, however, is create the context and data required to invoke a standard Revit external command. We have implemented a sample that creates an own custom tab and adds it to the Revit ribbon. It displays a command button which can be used to invoke Revit independent functionality.

The functionality to create a new custom panel and add a command button to it is provided by classes in the Autodesk.Windows namespace. These classes have no knowledge of Revit and its API, and we have not found any way to access the command data required to invoke an external command and make use of the Revit API from such a button. As long as you are happy just doing .NET stuff completely independently of Revit, you can make use of this. This functionality is unsupported, and to be used at your own risk, of course.

Continue reading...The Building Coder: Custom Ribbon Tab


  © Blogger template ProBlogger Template by Ourblogtemplates.com 2008

Back to TOP  

[Valid Atom 1.0]