Adds a menu item, or submenu and menu item, to shortcut menus of entities of the specified type in documents of the specified type.
.NET Syntax
Visual Basic (Declaration) | |
---|
Function AddMenuPopupItem4( _
ByVal DocumentType As System.Integer, _
ByVal Cookie As System.Integer, _
ByVal SelectType As System.String, _
ByVal As System.String, _
ByVal As System.String, _
ByVal As System.String, _
ByVal HintString As System.String, _
ByVal CustomNames As System.String _
) As System.Integer |
Visual Basic (Usage) | |
---|
Dim instance As ISldWorks
Dim DocumentType As System.Integer
Dim Cookie As System.Integer
Dim SelectType As System.String
Dim PopupItemName As System.String
Dim MenuCallback As System.String
Dim MenuEnableMethod As System.String
Dim HintString As System.String
Dim CustomNames As System.String
Dim value As System.Integer
value = instance.AddMenuPopupItem4(DocumentType, Cookie, SelectType, PopupItemName, MenuCallback, MenuEnableMethod, HintString, CustomNames) |
Parameters
- DocumentType
Document type as defined by swDocumentTypes_e
- Cookie
Cookie as defined in ISwAddin::ConnectToSW
- SelectType
Selection type as returned by IFeature::GetTypeName2
- PopupItemName
Description displayed on the shortcut menu
- MenuCallback
Function to call when this menu item is selected (see Remarks)
- MenuEnableMethod
Optional function that controls the state of the menu item
If specified:
If MenuEnableMethod 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 |
4 |
Hides the menu item |
(see Remarks)- HintString
- Text to show in the SOLIDWORKS status bar when the user moves a mouse over this menu item
- CustomNames
Semi-colon separated list of the names of the custom features; this argument is applicable only if SelectType is a custom feature type (like Attribute); in the case of Attribute, set this field to a list of attribute definitions
Return Value
SOLIDWORKS runtime command ID or -1 if the method fails
Remarks
See Also
Availability
SOLIDWORKS 2011 FCS, Revision Number 19.0