2024 Class
Changes 8
C

UIApplication

Description:
Represents an active session of the Autodesk Revit user interface, providing access to UI customization methods, events, the main window, and the active 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.
Inheritance Hierarchy:
System.Object
  Autodesk.Revit.UI.UIApplication
    Autodesk.Revit.UI.Macros.ApplicationEntryPoint
public class UIApplication : IDisposable
Name Return Type Description
C UIApplication(Application) None Use a database level Application to construct a UI-level Application.
Name Return Type Description
E ApplicationClosing event Subscribe to the ApplicationClosing event to be notified when the Revit application is just about to be closed.
E DialogBoxShowing event Subscribe to the DialogBoxShowing event to be notified when Revit is just about to show a dialog box or a message box.
E DisplayingOptionsDialog event Subscribe to the options dialog displaying event to be notified when Revit options dialog is displaying.
E DockableFrameFocusChanged event 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.
E DockableFrameVisibilityChanged event 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.
E FabricationPartBrowserChanged event Subscribe to MEP Fabrication part browser changed event to be notified when MEP Fabrication part browser is updated.
E FormulaEditing event Subscribe to the FormulaEditing event to be notified when the edit formula button has been clicked.
E Idling event Subscribe to the Idling event to be notified when Revit is not in an active tool or transaction.
E SelectionChanged event Subscribe to the SelectionChanged event to be notified after the selection was changed.
E ThemeChanged event Subscribe to the ThemeChanged event to be notified after the theme was changed.
E TransferredProjectStandards event Subscribe to the TransferredProjectStandards event to be notified after the scope of a Transfer Project Standards operation has been finalized.
E TransferringProjectStandards event 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.
E ViewActivated event Subscribe to the ViewActivated event to be notified immediately after Revit has finished activating a view of a document.
E ViewActivating event Subscribe to the ViewActivating event to be notified when Revit is just about to activate a view of a document.
Name Return Type Description
M CanPostCommand(RevitCommandId) bool Identifies if the given command can be posted, using .
M CreateAddInCommandBinding(RevitCommandId) AddInCommandBinding Creates a new AddInCommandBinding.
M CreateRibbonPanel(String) RibbonPanel Create a new RibbonPanel on the Add-Ins tab.
M CreateRibbonPanel(String, String) RibbonPanel Create a new RibbonPanel on the specified tab.
M CreateRibbonPanel(Tab, String) RibbonPanel Create a new RibbonPanel on the designated standard Revit tab.
M CreateRibbonTab(String) None Creates a new tab on the Revit user interface.
M Dispose() None Releases all resources used by the
M DoDragDrop(ICollection<String>) None Initiates a drag and drop operation of a collection of file names on the Revit user interface.
M DoDragDrop(Object, IDropHandler) None Initiates a drag and drop operation with a custom drop implementation.
M GetDockablePane(DockablePaneId) DockablePane Gets a DockablePane object by its ID.
M GetRibbonPanels() List<RibbonPanel> Get all the custom Panels on Add-Ins tab of Revit.
M GetRibbonPanels(String) List<RibbonPanel> Get all the custom Panels on a designated Revit tab.
M GetRibbonPanels(Tab) List<RibbonPanel> Get all the custom Panels on a designated standard Revit tab.
M LoadAddIn(String) None Loads add-ins from the given manifest file.
M LoadPackageContents(String) None Loads add-ins from the given packageContents.xml file.
M OpenAndActivateDocument(ModelPath, OpenOptions, Boolean) The opened document. Opens and activates a Revit document, include both local document or cloud document.
M OpenAndActivateDocument(ModelPath, OpenOptions, Boolean, IOpenFromCloudCallback) The opened document. Opens and activates a Revit document, include both local document or cloud document.
M OpenAndActivateDocument(String) The opened document. Opens and activates a Revit document.
M PostCommand(RevitCommandId) None Posts the command to the Revit message queue to be invoked when control returns from the current API context.
M RegisterDockablePane(DockablePaneId, String, IDockablePaneProvider) None Adds a new dockable pane to the Revit user interface.
M RemoveAddInCommandBinding(RevitCommandId) None Removes an AddInCommandBinding.
Name Return Type Description
P ActiveAddInId AddInId Get current active external application or external command id.
P ActiveUIDocument UIDocument Provides access to an object that represents the currently active project.
P Application Application Returns the database level Application represented by this UI level Application.
P DrawingAreaExtents Rectangle Get the rectangle that represents the screen pixel coordinates of drawing area.
P IsValidObject bool Specifies whether the .NET object represents a valid Revit entity.
P IsViewerModeActive bool Determines if Revit session is in Viewer mode.
P LoadedApplications ExternalApplicationArray Returns an array of successfully loaded external applications.
P MainWindowExtents Rectangle Get the rectangle that represents the screen pixel coordinates of the Revit main window.
P MainWindowHandle IntPtr Get the handle of the Revit main window.
P ProductIsRS bool Identifies if the current Revit product has an RS designation. Most add-ins will not need to use this information.