Thursday, February 19, 2009

What's New in the Revit 2010 API: User Interface

From the (What's New in Revit 2010 API series).

As you may know, Revit 2010 brings the Ribbon-style User-Interface to the world of Revit. Similar to bringing the Ribbon to Microsoft Office or AutoCAD - this has far-reaching effects on how users will navigate Revit.

For better or worse, ExternalCommands and ExternalApplications will be shoe-horned into the new Ribbon concept.

How it Works

First, if you have any "Add-ins" of any kind, the "Add-in" tab is visible in Revit.

Second, any ExternalCommands which previously were on the Tools > External Tools menu are now on the Add-Ins menu under the "External Tools" pulldown-button.

Third, there are a number of "constructs" for how you can customize the ribbon. Unlike AutoCAD's WPF Ribbon UI, you are limited to just a couple of UI elements.

The key elements are:

  • RibbonPanel - creating an "area" to contain your application

  • Pushbutton - a single Pushbutton command

  • PulldownButton - a button which drops down a list of commands

  • Separator - basic separation

Both Pushbuttons and PulldownButtons can have large (32x32) icons and small (16x16) icons (not shown above). The large icon is always displayed on the button, while the small icon is only shown if the user adds the button to the "Quick Access Toolbar" - which is always available.

Autodesk also released a 29-page document describing how icons should be created to fit in with Revit (who knew it could be so complicated? :) ).

Existing Applications

The existing APIs that applications use to create both top-level menus or toolbars have disappeared - so you MUST migrate to this approach.

Summary Opinion

While I think that it's great that the Ribbon has come to Revit - I really like it... The UI straightjacket that we've been put in with the UI is a little tight... It would be nice if we could at least do stacked buttons like the rest of Revit.

(Editors Note: Stacked buttons, 2 or 3 high - was added in the API after this was written)

It's also a little unfortunate that everything external is confined to the "AddIns" tab - both because we used to be able to have "top-level" menus, but also because if you have a lot of applications loaded, the real-estate may get crowded.


jonz said...

Have you managed to add buttons created from code to Quick Access Toolbar? In my case I loose them, once I restart Revit...

Matt Mason said...


I have noticed the same thing.
I meant to check if it was fixed in any of the later updates to 2010, but have not had the chance.