
If you’re developing custom add-ins or commands for SOLIDWORKS PDM, you may want to improve the user experience by organizing your commands into submenus. Fortunately, this is entirely possible using the IEdmCmdMgr5::AddCmd
method. As you add more commands, a cluttered context menu can quickly become overwhelming. Creating submenus allows you to group related commands under a parent label, keeping the interface clean and intuitive.
How to Create a Submenu
To create a submenu, use the double backslash (\\
in C# if not escaped) separator in the menu name when registering your command with AddCmd
.
Example
1 |
poCmdMgr.AddCmd(15065, "ParentMenu\\ChildMenu", 43, string.Empty, string.Empty, -1, 0); |
This code registers a new command under: Right-click > ParentMenu > ChildMenu
Important Notes
- Context Menu Only
Submenus created this way will only appear in the right-click (context menu) in Windows File Explorer. - No Modification of Built-In Menus
You cannot add your submenu to any of SOLIDWORKS PDM’s existing menus or built-in add-ins. This technique is reserved strictly for custom commands. - Use submenus to:
- Group related automation tools
- Separate user vs admin functions
- Clean up large sets of utility commands
Need help building PDM tools or structuring your add-ins? Reach out to Blue Byte Systems Inc. — we specialize in SOLIDWORKS PDM automation and custom development.