This functionality is only available for certain module packages. Info / Copyright

Inserting Menu Items Using a Script

Using a script you can insert one or more items to the Utilities menu. To do this, the [DeclareMenu] attribute is used to call up the MenuFunction() function. If the script is then loaded, the menu item specified by the AddMenuItem function is generated.

The overall structure of such a simple C# script thus looks like this:

public class <ScriptName>
{

     [DeclareMenu]
     public void MenuFunction()
     {

           Eplan.EplApi.Gui.Menu oMenu = new Eplan.EplApi.Gui.Menu();
           oMenu.AddMenuItem("<MenuText>","<ActionName>");

     }

}

A menu item is always linked with an action that is called up when the menu item is selected. This means that either the script has another action (via [DeclareAction]) or that the menu item is already assigned to an existing action.

See also