Obsolete. Superseded by ISldWorks::AddMenuItem4.
.NET Syntax
Visual Basic (Declaration) | |
---|
Function AddMenuItem3( _
ByVal DocumentType As System.Integer, _
ByVal Cookie As System.Integer, _
ByVal As System.String, _
ByVal Position As System.Integer, _
ByVal As System.String, _
ByVal As System.String, _
ByVal HintString As System.String, _
ByVal BitmapFilePath As System.String _
) As System.Boolean |
Visual Basic (Usage) | |
---|
Dim instance As ISldWorks
Dim DocumentType As System.Integer
Dim Cookie As System.Integer
Dim MenuItem As System.String
Dim Position As System.Integer
Dim MenuCallback As System.String
Dim MenuEnableMethod As System.String
Dim HintString As System.String
Dim BitmapFilePath As System.String
Dim value As System.Boolean
value = instance.AddMenuItem3(DocumentType, Cookie, MenuItem, Position, MenuCallback, MenuEnableMethod, HintString, BitmapFilePath) |
Parameters
- DocumentType
Document type to which the menu item is to be added as defined by swDocumentTypes_e
- Cookie
Cookie specified as defined in ISwAddin::ConnectToSW
- MenuItem
Menu string ("menuItem@subMenuString@menuString"); SolidWorks creates menus and submenus only if they do not already exist
NOTE: Use the & symbol to include an accelerator key, e.g., "MyItem@&File" adds MyItem to the File menu with an accelerator key. To display the accelerator key, press the Alt key in SolidWorks. The accelerator key is underlined.
- Position
Position at which to add the new menu item
The first item is at position 0; if Position is 1, the new menu item is added to the bottom of the list; this argument specifies the position of the menu item in relation to its immediate parent menu
- MenuCallback
Function to call when this menu item is selected
- MenuEnableMethod
Optional function that controls the state of the menu item
If specified, SolidWorks:
If your method returns... |
Then SolidWorks... |
0 |
Deselects and disables the menu item |
1 |
Deselects and enables the menu item; this is the default menu state if no update function is specified |
2 |
Selects and disables the menu item |
3 |
Selects and enables the menu item |
- HintString
Text to show in the SolidWorks status bar when the user moves their mouse over this menu item; if you specify a HintString, it must be preceded by a comma
- BitmapFilePath
Path and filename of bitmap
Return Value
True if menu item and bitmap are added, false if not
Example
Adding a menu separator:
' Adds a menu separator to a menu and a submenu (strings not shown as BSTR for clarity)
bRet = iSldWorks.AddMenuItem3(swDocNONE, iCookie, "@menuString", -1, "ExistingCallBackThatDoesNothing", "", "", "", "")
bRet = iSldWorks.AddMenuItem3(swDocNONE, iCookie, "@subMenuString@menuString", -1, "ExistingCallBackThatDoesNothing", "", "", "", "")
Remarks
See Also
Availability
SolidWorks 2005 FCS, Revision Number 13.0