IContext |
Interface class for Context Menu creation.
Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)

The IContextMenuCreator type exposes the following members.

Name | Description | |
---|---|---|
![]() | BuildContextMenu | Build a Context Menu. |

In order to customize Autodesk Revit context menus, create a class that implements the IContextMenuCreator interface.
An IExternalApplication can register one or more IContextMenuCreator subclasses using the RegisterContextMenu() method.
Whenever an end user right-clicks in Canvas or ProjectBrowser, all IContextMenuCreator buildContextMenu implementations are called on by one. Each buildContextMenu implementation is passed in an empty ContextMenu object. Depending on the active document, view and selection, you can add one or more MenuItems to the ContextMenu object. All MenuItems will be added in the end of the context menu presented to the user.
