From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use MenuItemInsert

I added a menu item and tried to set a function of my vbs as the target.

Call MenuItemInsert(T1,T2+".1","MENUITEM","Colored", "redraw_diagram(1)")

The target function is OK.
Clicking at the menu item causes following error:

Typen unverträglich 'redraw_diagram(1)'

Calling the function redraw_diagram wihtout parameters coused the same errror.

Please help!
0 Kudos
Message 1 of 3
(3,466 Views)
Have you registered the "redraw_diagram(1)" function as a user command?
Try putting this function into a separate file and registering it as a user command:

From DIAdem-AUTO please go the the menu bar and choose: "Settings" - "Desktop Parameters" - "User commands" and add the file containing the 'redraw_diagram" function here.

These user commands will always be loaded when DIAdem is started, so you won't have to load it every time you want to use the MenuItemInsert command.

Please let me know if this helps. If not, we'll have to try a different solution,

Otmar
Otmar D. Foehner
0 Kudos
Message 2 of 3
(3,466 Views)
Your answer is quite good but it misses the description how to register a user command via VBS!

Sorry but the DIAdem-Help is not really helpfull in such specific cases.


Thanx
0 Kudos
Message 3 of 3
(3,466 Views)