What is called an "action" in Eplan?
An action is a procedure or function that can be dynamically registered in Eplan. The action is identified by its name and its overload priority. An action can have any number of parameters, which are passed to and from the action via a so-called ActionCallingContext. Each ribbon button in Eplan is associated with an action that is called up when the ribbon button is clicked.
An add-in can add new actions to Eplan. Actions can be called from the command line and they can be assigned to a new ribbon button. A new action can override an existing action with the same name.
An action is implemented by a class that inherits the interface IEplAction. You need to add an implementation of all the functions of the interface. An add-in can contain an arbitrary number of actions.
There are some differences in how actions are implemented in .NET Framework and .NET 8:
As shown in the example above, please implement the GetActionProperties method if you use the .NET Framework 4.8.1 API.
For the new .NET 8 API, the functionality of the former GetActionProperties method is now moved to the IEplActionProperties interface. If you want to use it, please implement this interface as well:
The parameter of the ActionCallingContext type can be used to pass parameters to the action. For extracting the parameter values and for setting parameters (as return parameters!), the class ActionCallingContext provides a set of functions:
When an action is assigned to a ribbon button, these items are only enabled if the action is registered and enabled. You can enable / disable a registered action via the IEplActionEnable interface.