I am lookIng for a way to reduce the size oF the RMB menu inside the vault.
I have already moved all our tasks inside a sub menu and I would like to move the vault add-ins in a "add-in" sub folder but I cannot find a way to do it. Any idea?
as reference:
https://www.cati.com/blog/configuring-m ... pdm-users/
PDM customize RMB menu with sub menus
Re: PDM customize RMB menu with sub menus
how many add-ins do you have?!
I haven't touched the right click menu since I messed it all up for the Design group. I opened the setting from the group settings dialog and it was completely blank. Thought, "that's strange, oh well, I'll add the item I came here to add and move on." Well, everyone in the group now had just that one item in the right click menu. Too me a while to rebuild it; I couldn't figure out how to just set back to default. Found out that if a user is in more than one group the settings GUI just throws up its hands and starts carte blanche. It was like biting into a moldy sandwich, so I haven't gone back to that fridge.
I haven't touched the right click menu since I messed it all up for the Design group. I opened the setting from the group settings dialog and it was completely blank. Thought, "that's strange, oh well, I'll add the item I came here to add and move on." Well, everyone in the group now had just that one item in the right click menu. Too me a while to rebuild it; I couldn't figure out how to just set back to default. Found out that if a user is in more than one group the settings GUI just throws up its hands and starts carte blanche. It was like biting into a moldy sandwich, so I haven't gone back to that fridge.
Re: PDM customize RMB menu with sub menus
The menu structure for commands added by an add-in is controlled in the source code of the add-in itself. In the IEdmAddin5::GetAddinInfo method, commands are added via AddCmd, like this:
Code: Select all
poCmdMgr.AddCmd(CMD_ADJUST, "Test Addin\\Submneu\\Adjust Properties", (int)(EdmMenuFlags.EdmMenu_OnlyInContextMenu | EdmMenuFlags.EdmMenu_OnlyFiles), "Adjust Custom Properties", "Adjust Custom Properties", -1, 0);
poCmdMgr.AddCmd(CMD_GET_REV_DATA, "Test Addin\\Submneu\\Get Revision Data", (int)(EdmMenuFlags.EdmMenu_OnlyInContextMenu | EdmMenuFlags.EdmMenu_OnlyFiles), "Get Revision Data", "Get Revision Data", -1, 0);
Re: PDM customize RMB menu with sub menus
@JSculley thank you very much!
Did you disassemble the dll with resource editor or do you have some other tool you could kindly suggest me?
Did you disassemble the dll with resource editor or do you have some other tool you could kindly suggest me?
Re: PDM customize RMB menu with sub menus
@bnemec
the problem is one "huge" add in the maker didn't care to organize in sub menus... I have requested an improvement in that regard.
my Understanding is the setting of the menu is a per user base, but you can overwrite ALL users from the setup window at the users root iirc.
the problem is one "huge" add in the maker didn't care to organize in sub menus... I have requested an improvement in that regard.
my Understanding is the setting of the menu is a per user base, but you can overwrite ALL users from the setup window at the users root iirc.
Re: PDM customize RMB menu with sub menus
If you have Visual Studio, you can use ILDASM.EXE and ILASM.EXE to do the disassembly and reassembly. From a Visual Studio command prompt: launch the ildasm tool and open the DLL file (make a backup copy in case you make a mistake or it doesn't work for some reason):
From the file menu, select Dump', use the default settings and save the file: Depending on how the original DLL was built, you may end up with a single .il file, or a .il file and one or more .res files.
You can open the files with a text editor. You then search for the text of your menus, and you will find code like this for each menu item: Change the first string to have the menu structure you want, using double backslashes to separate them:
Once you have changed them all, you use ILASM.EXE from the developer command prompt to reassemble the code.
Code: Select all
E:\SOLIDWORKS Files>ilasm /DLL CustomPropertyCleaner.il
===========================================================
Microsoft (R) .NET Framework IL Assembler. Version 4.8.3761.0
Copyright (c) Microsoft Corporation. All rights reserved.
Assembling 'CustomPropertyCleaner.il' to DLL --> 'CustomPropertyCleaner.dll'
Source file is UTF-8
...
...
...
...
Class 89
Method Implementations (total): 2
Resolving local member refs: 0 -> 0 defs, 0 refs, 0 unresolved
Writing PE file
Operation completed successfully
E:\SOLIDWORKS Files>
Code: Select all
E:\SOLIDWORKS Files>ilasm /DLL /RES=res1.res /RES=res2.res /CustomPropertyCleaner.il
If it works, you should see your new menu structure, like this:
Also, this will only work for .NET DLL files. If the add-in was written in plain C++, none of this will work. All my tests were done using a C# DLL.
Re: PDM customize RMB menu with sub menus
@JSculley thank you for the explaination, but the add-in I got is signed and encrypted apparently.