Scripts with New Actions

You can load and unload scripts in Eplan. If you do this, the start function is not executed, but rather special functions are registered in Eplan. You can insert a new action or a command in Eplan, or you can have functions registered in order to have them react to special Eplan events.

To insert a new action in the program, the function in the script has to be identified by the [DeclareAction] attribute. Using the parameter of the [DeclareAction()] attribute, you can specify the name of the new action in Eplan.

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

public class <ScriptName>
{

     [DeclareAction("<ActionName>")]
     public void <FunctionName>
     {

           //<Enter your code text here>
           return;

     }

}

After a corresponding script (with [DeclareAction]) has been loaded via the command Load (command path: File > Extras > Command group Extensions > Interfaces > Command group Scripts > Load), the new action can be used like any other action in Eplan. It can, for example, be called up via the command line or it can be added to a command in the ribbon.

As soon as a script has been loaded once, it will automatically be loaded and ready for use the next time you start Eplan. The deactivation of such a script takes place in the Backstage view Extras via the command Unload.

See also