Share

ControlDefinition Object


Description

The ControlDefinition object is the base class for all other command definition types. This includes the following objects: ButtonDefinition, ComboBoxDefinition, and MacroControlDefinition.

Methods

Name Description
AutoAddToGUI Method that automatically adds a control based on this definition to the General panel of the Add-Ins tab in the ribbon interface.
Delete Method that deletes the control definition. This method fails for built-in definitions.
Execute Method that runs the built-in command or sends the Click event to the Add-In. The end result of calling the Execute method is the same as if the user had clicked/pressed the relevant control - for example, by clicking on a button that references a ButtonDefinition object.
Execute2 Method that executes the control definition synchronously or asynchronously.

Properties

Name Description
Application Returns the top-level parent application object. When used the context of Inventor, an Application object is returned. When used in the context of Apprentice, an ApprenticeServer object is returned.
BuiltIn Property that specifies if the control or definition is a standard Autodesk Inventor control or definition. Built-in ones have restrictions in the edits that can be performed.
Classification Property that returns the command classification of the ControlDefinition. These classifications are bits and can be combined to designate that a command falls within more than one classification. Because they are bits, care needs to be taken when interpreting the returned values.
ClientId Property that returns the string that uniquely identifies the client. This is the CLSID of the AddIn in a string form, e.g. "{C9A6C580-3817-11D0-BE4E-080036E87B02}".
DefaultShortcut Gets/Sets the default (internal) shortcut assigned to the command. Setting this property fails for built-in ControlDefinitions.
DefaultShortcutType Property that returns the type of shortcut assigned to this command.
DefinitionType Property that returns the control definition type. The possible return values are kButtonDefinition, kComboBoxDefinition, and kMacroControlDefinition.
DescriptionText Gets/Sets Description Text. For MacroControlDefinition this property is read-only.
DisplayName Property that returns the display name of the ControlDefinition.
Enabled Enables/Disables the UIDefinition object.
InternalName Property that returns the internal name. This name is the internal unique identifier for the ControlDefinition.
IntroducedInVersion Read-write property that gets and sets the introduced in version of the control definition. The values from AvailableComparisonVersions can be used to set this property. This is read only if the control definition is built-in or if it is MacroControlDefinition.
IsShortcutOverridden Property that returns whether the default (internal) shortcut has been overridden by the user or through the API.
LargeIcon Gets/Sets LargeIcon. For MacroControlDefinition this property is read-only.
LastUpdatedVersion Read-write property that gets and sets the last updated version of the control definition. The values from AvailableComparisonVersions can be used to set this property. This is read only if the control definition is built-in or if it is MacroControlDefinition.
OverrideShortcut Gets/Sets the override shortcut assigned to the command. Setting this property to a null string clears the override.
OverrideShortcutType Property that returns the type of override shortcut assigned to this command.
Parent Property that returns the parent object from whom this object can logically be reached.
ProgressiveToolTip Property that returns a ProgressiveToolTip object providing access to enhanced tooltip display for controls in the ribbon interface.
StandardIcon Gets/Sets StandardIcon. For MacroControlDefinition this property is read-only.
ToolTipText Gets/Sets Tooltip. For MacroControlDefinition this property is read-only
Type Returns an ObjectTypeEnum indicating this object's type.

Accessed From

ButtonDefinitionHandler.ControlDefinition, CommandBarButton.ControlDefinition, CommandBarButton.DisplayedControl, CommandBarControl.ControlDefinition, CommandBarControl.DisplayedControl, CommandBarPopUp.ControlDefinition, CommandBarPopUp.DisplayedControl, CommandControl.ControlDefinition, CommandControl.DisplayedControl, ControlDefinitionEvents.Parent, ControlDefinitions.Item, DisabledCommandList.Item, DockableWindow.VisibilityControl, ProgressiveToolTip.Parent, WebBrowserDockableWindow.VisibilityControl

Derived Classes

MacroControlDefinition

Samples

Name Description
Copy a sketch This sample demonstrates copying the contents of a sketch into another sketch via the API.
Add parallel environment with contextual tabs The following sample demonstrates the use of parallel environments and contextual ribbon tabs.
Print list of all Inventor Commands This sample prints the internal names and descriptions of all commands (aka ControlDefinitions) in Inventor.
Post Private Event Sample This sample demonstrates how to use the PostPrivateEvent to configure the options for placing a part component.
Break alignment of a section view Sample showing how to break the alignment of a drawing section view by calling the DrawingBreakViewAlignment command.

Version

Introduced in version 6

Was this information helpful?