Hide Table of Contents
AddCmd Method (IEdmCmdMgr5)

Adds a toolbar button to the Windows Explorer Tools menu and a menu command to the right-click context-sensitive menu of SOLIDWORKS PDM Professional vault files and folders.


Visual Basic (Declaration) 
Sub AddCmd( _
   ByVal lCmdID As System.Integer, _
   ByVal bsMenuString As System.String, _
   Optional ByVal lEdmMenuFlags As System.Integer, _
   Optional ByVal bsStatusBarHelp As System.String, _
   Optional ByVal bsToolbarToolTip As System.String, _
   Optional ByVal lToolbarButtonIndex As System.Integer, _
   Optional ByVal lToolbarImageID As System.Integer _
void AddCmd( 
   System.int lCmdID,
   System.string bsMenuString,
   System.int lEdmMenuFlags,
   System.string bsStatusBarHelp,
   System.string bsToolbarToolTip,
   System.int lToolbarButtonIndex,
   System.int lToolbarImageID
void AddCmd( 
&   System.int lCmdID,
&   System.String^ bsMenuString,
&   System.int lEdmMenuFlags,
&   System.String^ bsStatusBarHelp,
&   System.String^ bsToolbarToolTip,
&   System.int lToolbarButtonIndex,
&   System.int lToolbarImageID


Command ID (see Remarks)
Text to show in the menu
Optional combination of EdmMenuFlags
Optional text to show in the Windows Explorer status bar when the user highlights the menu entry in the right-click context menu
Optional message to display when the cursor is located over the command's toolbar button
Optional index of a toolbar button in a resource image (see Remarks)
Optional ID of the image to use as a toolbar button (see Remarks)


Call this method in your implementation of IEdmAddIn5::GetAddInInfo to:

  • Add command buttons to the Windows Explorer toolbar. Before calling IEdmCmdMgr5::AddCmd, call IEdmCmdMgr5::AddToolbarImage to register an image with the toolbar button you want to add.
  • Add menu commands to the Windows Explorer Tools menu.
  • Add menu commands to the right-click context menu of files or folders in the SOLIDWORKS PDM Professional vault.

lCmdID can be any value. SOLIDWORKS PDM Professional passes it to your implementation of IEdmAddIn5::OnCmd via EdmCmd::mlCmdID.

lToolbarButtonIndex is the index of the toolbar image in a resource image that contains several images.

lToolbarImageID is the same as the lImageID parameter of IEdmCmdMgr5::AddToolbarImage.

NOTE: Menu commands and toolbar buttons added using this method display only when the user browses a SOLIDWORKS PDM Professional file vault. They do not display for ordinary Windows folders.

Return codes:

  • S_OK: The method successfully executed.
  • S_FALSE: One of the arguments is invalid. 

See Also


SOLIDWORKS PDM Professional Version 5.2

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:   AddCmd Method (IEdmCmdMgr5)
*   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) 2018 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.