Hide Table of Contents
AddMenuPopupIcon2 Method (IFrame)

Adds an icon to a context-sensitive menu of a SolidWorks add-in.

.NET Syntax

Visual Basic (Declaration) 
Function AddMenuPopupIcon2( _
   ByVal DocType As Integer, _
   ByVal SelectType As Integer, _
   ByVal HintString As String, _
   ByVal Identifier As Integer, _
   ByVal CallbackFunction As String, _
   ByVal CallbackUpdateFunction As String, _
   ByVal CustomNames As String, _
   ByVal BitmapFilePath As String _
) As Boolean
Visual Basic (Usage) 
Dim instance As IFrame
Dim DocType As Integer
Dim SelectType As Integer
Dim HintString As String
Dim Identifier As Integer
Dim CallbackFunction As String
Dim CallbackUpdateFunction As String
Dim CustomNames As String
Dim BitmapFilePath As String
Dim value As Boolean
value = instance.AddMenuPopupIcon2(DocType, SelectType, HintString, Identifier, CallbackFunction, CallbackUpdateFunction, CustomNames, BitmapFilePath)
bool AddMenuPopupIcon2( 
   int DocType,
   int SelectType,
   string HintString,
   int Identifier,
   string CallbackFunction,
   string CallbackUpdateFunction,
   string CustomNames,
   string BitmapFilePath
bool AddMenuPopupIcon2( 
&   int DocType,
&   int SelectType,
&   String^ HintString,
&   int Identifier,
&   String^ CallbackFunction,
&   String^ CallbackUpdateFunction,
&   String^ CustomNames,
&   String^ BitmapFilePath


Document type whose context-sensitive menus display the icon
Selection type whose context-sensitive menus display the icon
Text displayed in the SolidWorks status bar when the user moves the mouse over the icon
ID of the add-in; value of the Cookie argument passed by ISwAddin::ConnectToSW
Function called when user clicks the context-sensitive menu icon (see Remarks)
Optional function that controls the state of the icon; if specified, then SolidWorks calls this function before displaying the icon

If CallbackUpdateFunction returns...

Then SolidWorks...


Deselects and disables the item


Deselects and enables the item; this is the default state if no update function is specified


Hides the item
(see Remarks)
Names of custom feature types (see Remarks)
Path and filename of the bitmap for the context-sensitive menu icon

Return Value

True if the context-sensitive menu icon is added, false if not



See Add-in Callback and Enable Methods to learn how to specify CallbackFunction and CallbackUpdateFunction.

When the icon is clicked, the function specified in CallbackFunction can perform actions such as displaying a third-party pop-up menu.

CustomNames is semi-colon separated list of the names of the custom feature types. This argument is applicable only if SelectType is a custom feature type (like swSelATTRIBUTES); in the case of swSelATTRIBUTES, set this field to the name of the attribute definition.


See Also


SolidWorks 2011 FCS, Revision Number 19.0

Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

Subject:   Feedback on Help Topics
Page:   AddMenuPopupIcon2 Method (IFrame)
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:


We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again

Web Help Content Version: API Help (English only) 2012 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.