Adds a combination menu and toolbar item to a CommandGroup.
.NET Syntax
Visual Basic (Usage) | |
---|
Dim instance As ICommandGroup
Dim Name As String
Dim Position As Integer
Dim HintString As String
Dim ToolTip As String
Dim ImageListIndex As Integer
Dim CallbackFunction As String
Dim EnableMethod As String
Dim UserID As Integer
Dim MenuTBOption As Integer
Dim value As Integer
value = instance.AddCommandItem2(Name, Position, HintString, ToolTip, ImageListIndex, CallbackFunction, EnableMethod, UserID, MenuTBOption)
|
Parameters
- Name
- Name of the item to add to the CommandGroup
- Position
Position of the item within the CommandGroup
NOTE: Specify 0 to add this item to the beginning of the CommandGroup, or specify -1 to add it to the end of the CommandGroup. This argument specifies the position of the item in relation to its immediate parent item.
- HintString
- Text displayed in the SolidWorks status bar when the pointer is on the item
- ToolTip
- ToolTip displayed when the pointer is on the item
- ImageListIndex
- Index number of the image for the item in the parent CommandGroup (see Remarks)
- CallbackFunction
Function to call when this item is selected
- EnableMethod
- Optional function that controls the state of the item; if specified, then SolidWorks calls this function before displaying the item
If your method returns... |
Then the SolidWorks software... |
0 |
Deselects and disables the item |
1 |
Deselects and enables the item; this is the default state if no update function is specified |
2 |
Selects and disables the item |
3 |
Selects and enables the item |
4 |
Hides the item |
- UserID
User-defined command ID or 0 if not used
- MenuTBOption
Command item type as defined in swCommandItemType_e
Return Value
Index of the item within the CommandGroup as assigned by SolidWorks
Example
Remarks
See Also
Availability
SolidWorks 2007 FCS, Revision Number 15