Thursday, March 25, 2010

Revit API 2011: The New UI vs. Database Split

(Part of our Revit API 2011 Series)
One interesting development in the Revit 2011 API is the splitting of the single Revit API into two – a Revit User-Interface DLL and a core Revit database DLL.

The “RevitAPI.dll” continues to cover the core database, while the new “RevitAPIUI.dll” covers the user-interface integration. This split extends to the core of the object model as well – while in the past the two primary classes in the API were Application and Document. Now, these classes have been split into:

  • UIApplication and Application
  • UIDocument and Document

UIApplication has picked up the classes and methods defining the RibbonPanels, the loaded applications, and some UI-oriented events like view changes and dialog boxes. The Application class retains the rest of the core application capability.

UIDocument picks up some of the UI-oriented aspects of the document, like selection, showing elements, and refreshing the active view.

The IExternalCommand and IExternalApplication interfaces live in the RevitAPIUI.dll, so all Add-In DLLs will have to reference the new DLL.

What does it all mean?

I don’t know this for certain, but I’m hopeful that this signals a shift towards an ability to access the Revit model outside of the user interface (similar to ObjectDBX/RealDWG on the AutoCAD side). I’m sure this is a hard feature for the factory to pursue – but here’s hoping that we might see it in a release or two.

No comments: