API Help
EPLAN API / User Guide / API Framework / Add-ins / Adding menu points
In This Topic
    Adding menu points
    In This Topic

    An add-in can add one or more menu points to the "Utilities" menu of EPLAN. There fore the class Eplan.EplApi.Gui.Menu provides a function addMenuItem which has to be called in the OnInitGui() function of the add-in module class: 

     

    /// <summary>
    /// This function is called by the framework of EPLAN, when the framework already has initialized its
    /// graphical user interface (GUI) and the add-in can start to modify the GUI.
    /// The function only is called, if the add-in is loaded on system-startup.
    /// </summary>
    /// <returns>true, if function succeeds</returns>
    public bool OnInitGui()
    {
       Eplan.EplApi.Gui.Menu oMenu = new Eplan.EplApi.Gui.Menu();
       oMenu.AddMenuItem("CSharpAction", "CSharpAction");
       return true;
    }
    
    ''' <summary>
    ''' This function is called by the framework of EPLAN, when the framework already has initialized its
    ''' graphical user interface (GUI) and the add-in can start to modify the GUI.
    ''' The function only is called, if the add-in is loaded on system-startup.
    ''' </summary>
    ''' <returns>true, if function succeeds</returns>
    Public Function OnInitGui() As Boolean Implements IEplAddin.OnInitGui
       Dim oMenu As Eplan.EplApi.Gui.Menu = New Eplan.EplApi.Gui.Menu
       oMenu.AddMenuItem("CSharpAction", "CSharpAction")
       Return True
    End Function 'OnInitGui
    

     

    The function AddMenuItem() adds a menu point with the text "CSharpAction" and assigns the action "CSharpAction" to this menu point. 

    Menu points always have to be assigned to an action. this means you need to implement a new action in your add-in or you could assign the new menu point to an already existing action.