> AddMenu Method (ISldWorks)
Welcome
Getting Started
SolidWorks API Help
FeatureWorks API Help
SolidWorks Document Manager API Help
eDrawings API Help
SolidWorks Routing API Help
SolidWorks Simulation API Help
SolidWorks Utilities API Help
SolidWorks Workgroup PDM API Help
Hide Table of Contents Show Table of Contents
AddMenu Method (ISldWorks)

Adds a menu or sub-menu item to the SolidWorks interface for DLL applications.

.NET Syntax

Visual Basic (Declaration) 
Function AddMenu( _
   ByVal DocType As Integer, _
   ByVal Menu As String, _
   ByVal Position As Integer _
) As Integer
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim DocType As Integer
Dim Menu As String
Dim Position As Integer
Dim value As Integer
 
value = instance.AddMenu(DocType, Menu, Position)
C# 
int AddMenu( 
   int DocType,
   string Menu,
   int Position
)
C++/CLI 
int AddMenu( 
&   int DocType,
&   String^ Menu,
&   int Position
) 

Parameters

DocType

Document type to which the menu item is to be added as defined by swDocumentTypes_e

Menu
Menu name to be added, including any parent menu names, for example "subMenuString@menuString"
Position

Specifies the position at which to add the new menu or submenu. 0 specifies the first position; if position is 1, the new menu or submenu is added to the bottom of the parent menu

Return Value

1 if menu item was successfully added, 0 if failure

Remarks

For consistency, you should add pulldown menu items between the existing Tools and Window menu items that appear in the SolidWorks menu bar.

Submenus are automatically created at the end of the parent menu when using ISldWorks::AddMenuItem3. Therefore, if your menu structure is created in order using sequential calls to SldWorks::AddMenuItem3, then all the menu items are positioned based on their order of creation.

This method is only required when a menu or submenu needs to be placed into an existing menu at a specific position. For example, your main menu should be positioned between the existing Tools and Window menu items that appear in the SolidWorks menu bar. Therefore, you should use this method to generate your main menu item.

Read about Add-in Shortcut Menus.

 

See Also

Availability

SolidWorks 99, datecode 1999207


Related SolidWorks Forum Content

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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   AddMenu Method (ISldWorks)
*Comment:  
x

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
x

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

The search functionality within the web help is in a beta test phase and you may experience periodic delays or interruptions in its performance. These are the normal and ordinary features of a beta test and shall not under any circumstances give rise to any liability on the part of DS SolidWorks or its licensors. The topics within the Web-based help are not beta topics; they document 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.