Share

CommandMenuItem Class

A class representing a single command menu item.

Inheritance Hierarchy

System.Object
  Autodesk.Revit.UI.MenuItem
    Autodesk.Revit.UI.CommandMenuItem


Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 26.2.0.0 (26.2.0.0)

Syntax

C#

public class CommandMenuItem : MenuItem

The CommandMenuItem type exposes the following members.

Constructors

 NameDescription
Public methodCommandMenuItem Initialize the item data.

Properties

 NameDescription
Public propertyIsValidObject Specifies whether the .NET object represents a valid Revit entity.
(Inherited from MenuItem)

Methods

 NameDescription
Public methodDispose
(Inherited from MenuItem)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodSetAvailabilityClassName Set availabilityClassName of CommandMenuItem
Public methodSetToolTip Set toolTip of CommandMenuItem
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)

Remarks

To add a menu item that can be executed, implement IExternalCommand interface and pass external command class name to CommandMenuItem constructor, create the CommandMenuItem object and use AddItem() method to add the object to context menu.

See Also

Reference

Was this information helpful?