UIApplication Class

UIApplication Class

Represents an active session of the Autodesk Revit user interface, providing access to UI customization methods, events, the main window, and the active document.
Inheritance Hierarchy
SystemObject
  Autodesk.Revit.UIUIApplication
    Autodesk.Revit.UI.MacrosApplicationEntryPoint

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public class UIApplication : IDisposable
Public Class UIApplication
	Implements IDisposable
public ref class UIApplication : IDisposable
type UIApplication = 
    class
        interface IDisposable
    end

The UIApplication type exposes the following members.

Constructors
 NameDescription
Public methodUIApplication Use a database level Application to construct a UI-level Application.
Top
Properties
 NameDescription
Public propertyActiveAddInId Get current active external application or external command id.
Public propertyActiveUIDocumentProvides access to an object that represents the currently active project.
Public propertyApplication Returns the database level Application represented by this UI level Application.
Public propertyDrawingAreaExtentsGet the rectangle that represents the screen pixel coordinates of drawing area.
Public propertyIsValidObject Specifies whether the .NET object represents a valid Revit entity.
Public propertyIsViewerModeActive Determines if Revit session is in Viewer mode.
Public propertyLoadedApplications Returns an array of successfully loaded external applications.
Public propertyMainWindowExtentsGet the rectangle that represents the screen pixel coordinates of the Revit main window.
Public propertyMainWindowHandleGet the handle of the Revit main window.
Public propertyProductIsRS Identifies if the current Revit product has an RS designation. Most add-ins will not need to use this information.
Top
Methods
 NameDescription
Public methodCanPostCommand Identifies if the given command can be posted, using PostCommand(RevitCommandId).
Public methodCreateAddInCommandBindingCreates a new AddInCommandBinding.
Public methodCreateRibbonPanel(String) Create a new RibbonPanel on the Add-Ins tab.
Public methodCreateRibbonPanel(String, String) Create a new RibbonPanel on the specified tab.
Public methodCreateRibbonPanel(Tab, String) Create a new RibbonPanel on the designated standard Revit tab.
Public methodCreateRibbonTab Creates a new tab on the Revit user interface.
Public methodDisposeReleases all resources used by the UIApplication
Public methodStatic memberDoDragDrop(ICollectionString) 
Public methodStatic memberDoDragDrop(Object, IDropHandler)Initiates a drag and drop operation with a custom drop implementation.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetDockablePaneGets a DockablePane object by its ID.
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetRibbonPanels Get all the custom Panels on Add-Ins tab of Revit.
Public methodGetRibbonPanels(String) Get all the custom Panels on a designated Revit tab.
Public methodGetRibbonPanels(Tab) Get all the custom Panels on a designated standard Revit tab.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodLoadAddInLoads add-ins from the given manifest file.
Public methodLoadPackageContentsLoads add-ins from the given packageContents.xml file.
Public methodOpenAndActivateDocument(String) Opens and activates a Revit document.
Public methodOpenAndActivateDocument(ModelPath, OpenOptions, Boolean) Opens and activates a Revit document, include both local document or cloud document.
Public methodOpenAndActivateDocument(ModelPath, OpenOptions, Boolean, IOpenFromCloudCallback) Opens and activates a Revit document, include both local document or cloud document.
Public methodPostCommand Posts the command to the Revit message queue to be invoked when control returns from the current API context.
Public methodRegisterContextMenuAdds a new context menu creator.
Public methodRegisterDockablePaneAdds a new dockable pane to the Revit user interface.
Public methodRemoveAddInCommandBindingRemoves an AddInCommandBinding.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
Events
 NameDescription
Public eventApplicationClosing Subscribe to the ApplicationClosing event to be notified when the Revit application is just about to be closed.
Public eventDialogBoxShowing Subscribe to the DialogBoxShowing event to be notified when Revit is just about to show a dialog box or a message box.
Public eventDisplayingOptionsDialog Subscribe to the options dialog displaying event to be notified when Revit options dialog is displaying.
Public eventDockableFrameFocusChanged Subscribe to this event to be notified when a Revit GenericDockableFrame has gained focus or lost focus in the Revit user interface. This event is called only for API-created GenericDockableFrames.
Public eventDockableFrameVisibilityChanged Subscribe to this event to be notified when a Revit GenericDockableFrame has been shown or hidden in the Revit user interface. This event is called only for API-created GenericDockableFrames.
Public eventExternalDataManagerChanged Subscribe to ExternalDataManager changed event to be notified.
Public eventFabricationPartBrowserChanged Subscribe to MEP Fabrication part browser changed event to be notified when MEP Fabrication part browser is updated.
Public eventFormulaEditing Subscribe to the FormulaEditing event to be notified when the edit formula button has been clicked.
Public eventIdling Subscribe to the Idling event to be notified when Revit is not in an active tool or transaction.
Public eventMacroUpdated MacroUpdated.
Public eventSelectionChanged Subscribe to the SelectionChanged event to be notified after the selection was changed.
Public eventThemeChanged Subscribe to the ThemeChanged event to be notified after the theme was changed.
Public eventTransferredProjectStandards Subscribe to the TransferredProjectStandards event to be notified after the scope of a Transfer Project Standards operation has been finalized.
Public eventTransferringProjectStandards Subscribe to the TransferringProjectStandards event to be notified before the scope of an impending Transfer Project Standards operation has been finalized in the Transfer Project Standards dialog.
Public eventViewActivated Subscribe to the ViewActivated event to be notified immediately after Revit has finished activating a view of a document.
Public eventViewActivating Subscribe to the ViewActivating event to be notified when Revit is just about to activate a view of a document.
Top
Remarks
You can access documents from the database level Application object, obtained from the Application property. If you have an instance of the database level Application object, you can construct a UIApplication instance from it.
See Also