A script can add one or more items to the EPLAN ribbon. The convenient place to add these items is a function with [DeclareRegister] attribute, then the items are registered until the script is unloaded:
A ribbon command is always connected with an action, which is called, when the command is clicked. This means the script either additionally registers an action, or the command is assigned to an already existing action.
Please mind, that users may start EPLAN in QUIET mode using W3u.exe /Quiet or the API could be initialized by an offline program. Because of this, it is not recommended to show .NET dialogs in the method marked by [DeclareRegister]. Please use Eplan.EplApi.Base.Decider class instead. If you encounter some problem during registering or initializing an script, just create and throw a BaseException or use BaseException.FixMessage(...) to add the message to the system messages list.
By the [DeclareRegister] attribute the function buttonWithAction() will be called during loading the script. The function creates a new ribbon command "MyMenuText" and binds it the action "HelloWorldAction".