using System.Windows.Forms; using Eplan.EplApi.Scripting; public class Class { [DeclareAction("MenuAction1")] public void ActionFunction1() { MessageBox.Show("Action 1 wurde ausgeführt!"); return; } [DeclareAction("MenuAction2")] public void ActionFunction2() { MessageBox.Show("Action 2 wurde ausgeführt!"); return; } [DeclareMenu] public void MenuFunction() { uint intIDUntermenue1; // MenuID Eplan.EplApi.Gui.Menu oMenu = new Eplan.EplApi.Gui.Menu(); //intIDUntermenue intIDUntermenue1 = oMenu.AddMainMenu( "MeineFirma", // Name: Menü "Fenster", // neben Menüpunkt "erster Menüpunkt", // Name: Menüpunkt "MenuAction1", // Name: Action "Statustext1", // Statustext 0 // 1 = hinter Menüpunkt, 0 = vor Menüpunkt ); oMenu.AddMenuItem( "zweiter Menüpunkt", // Name: Menüpunkt "MenuAction2", // Name: Action "Statustext2", // Statustext intIDUntermenue1, // Menü-ID 1, // 1 = Hinter Menüpunkt, 0 = Vor Menüpunkt false, // Seperator davor anzeigen false // Seperator dahinter anzeigen ); } }