IContextMenuCreator Interface


IContext Menu Creator Interface

Interface class for Context Menu creation.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public interface IContextMenuCreator

The IContextMenuCreator type exposes the following members.

Methods
Name Description
Public method BuildContextMenu Build a Context Menu.
Top
Remarks

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.

See Also
ArchiLabs

Stop fighting Revit automation.

Build repeatable BIM design and documentation workflows with scripts, data, and AI in one place, without wrestling brittle one-off automations.

Try ArchiLabs →