Skip to content

UIApplication

Public 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

System.Object
Autodesk.Revit.UI.UIApplication
Autodesk.Revit.UI.Macros.ApplicationEntryPoint

Namespace: Autodesk.Revit.UI

Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public class UIApplication : IDisposable

The UIApplication type exposes the following members.

Constructors

Name

Description


Public Method
UIApplication

Use a database level Application to construct a UI-level Application.


Properties

Name

Description


Public Property

Get current active external application or external command id.


Public Property
ActiveUIDocument

Provides access to an object that represents the currently active project.


Public Property

Returns the database level Application represented by this UI level Application.


Public Property
DrawingAreaExtents

Get the rectangle that represents the screen pixel coordinates of drawing area.


Public Property
IsValidObject

Specifies whether the .NET object represents a valid Revit entity.


Public Property

Determines if Revit session is in Viewer mode.


Public Property
LoadedApplications

Returns an array of successfully loaded external applications.


Public Property

Get the rectangle that represents the screen pixel coordinates of the Revit main window.


Public Property
MainWindowHandle

Get the handle of the Revit main window.


Public Property

Identifies if the current Revit product has an RS designation. Most add-ins will not need to use this information.


Methods

Name

Description


Public Method
CanPostCommand

Identifies if the given command can be posted, using

.


Public Method

Creates a new AddInCommandBinding.


Public Method
Code Example
CreateRibbonPanel(String)

Create a new RibbonPanel on the Add-Ins tab.


Public Method
CreateRibbonPanel(String, String)

Create a new RibbonPanel on the specified tab.


Public Method
CreateRibbonPanel(Tab, String)

Create a new RibbonPanel on the designated standard Revit tab.


Public Method
CreateRibbonTab

Creates a new tab on the Revit user interface.


Public Method

Releases all resources used by the UIApplication


Public Method
Static Member
DoDragDrop(ICollection.String.)

Initiates a drag and drop operation of a collection of file names on the Revit user interface.


Public Method
Static Member
DoDragDrop(Object, IDropHandler)

Initiates a drag and drop operation with a custom drop implementation.


Public Method

Equals

Determines whether the specified object is equal to the current object.
(Inherited from Object)


Public Method

Gets a DockablePane object by its ID.


Public Method

GetHashCode

Serves as the default hash function.
(Inherited from Object)


Public Method
GetRibbonPanels.

Get all the custom Panels on Add-Ins tab of Revit.


Public Method
GetRibbonPanels(String)

Get all the custom Panels on a designated Revit tab.


Public Method
GetRibbonPanels(Tab)

Get all the custom Panels on a designated standard Revit tab.


Public Method

GetType

Gets the Type of the current instance.
(Inherited from Object)


Public Method
LoadAddIn

Loads add-ins from the given manifest file.


Public Method

Loads add-ins from the given packageContents.xml file.


Public Method
OpenAndActivateDocument(String)

Opens and activates a Revit document.


Public Method
OpenAndActivateDocument(ModelPath, OpenOptions, Boolean)

Opens and activates a Revit document, include both local document or cloud document.


Public Method
OpenAndActivateDocument(ModelPath, OpenOptions, Boolean, IOpenFromCloudCallback)

Opens and activates a Revit document, include both local document or cloud document.


Public Method

Posts the command to the Revit message queue to be invoked when control returns from the current API context.


Public Method
RegisterContextMenu

Adds a new context menu creator.


Public Method

Adds a new dockable pane to the Revit user interface.


Public Method

Removes an AddInCommandBinding.


Public Method

ToString

Returns a string that represents the current object.
(Inherited from Object)


Events

Name

Description


Public Event
ApplicationClosing

Subscribe to the ApplicationClosing event to be notified when the Revit application is just about to be closed.


Public Event
Code Example
DialogBoxShowing

Subscribe to the DialogBoxShowing event to be notified when Revit is just about to show a dialog box or a message box.


Public Event

Subscribe to the options dialog displaying event to be notified when Revit options dialog is displaying.


Public Event
DockableFrameFocusChanged

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 Event
DockableFrameVisibilityChanged

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 Event
FabricationPartBrowserChanged

Subscribe to MEP Fabrication part browser changed event to be notified when MEP Fabrication part browser is updated.


Public Event

Subscribe to the FormulaEditing event to be notified when the edit formula button has been clicked.


Public Event
Code Example
Idling

Subscribe to the Idling event to be notified when Revit is not in an active tool or transaction.


Public Event
MacroUpdated

MacroUpdated.


Public Event
SelectionChanged

Subscribe to the SelectionChanged event to be notified after the selection was changed.


Public Event
ThemeChanged

Subscribe to the ThemeChanged event to be notified after the theme was changed.


Public Event
TransferredProjectStandards

Subscribe to the TransferredProjectStandards event to be notified after the scope of a Transfer Project Standards operation has been finalized.


Public Event
TransferringProjectStandards

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 Event
ViewActivated

Subscribe to the ViewActivated event to be notified immediately after Revit has finished activating a view of a document.


Public Event
ViewActivating

Subscribe to the ViewActivating event to be notified when Revit is just about to activate a view of a document.


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.