In Eplan, you have the capability of executing scripts. Scripts are small executable program codes that are written within Eplan in the C# or Visual Basic.Net programming languages. They always exist as source code files (file extension *.cs or *.vb). In Eplan these scripts access the API interface without you having to also license the Eplan API.
When you start a script, it is loaded in the system, compiled and then executed. The following scripts are available:
- "Simple" scripts whose functions are run once can be started via the command Run (command path: File > Extras > Command group Extensions > Interfaces > Command group Scripts > Run).
- Other scripts like the ones that make your own actions or commands available are registered permanently in Eplan and executed via the Load command. To deactivate scripts of this kind, go to the command Unload.
Scripting in Eplan offers you the following options:
- Using a script you can execute a function once.
- Scripts can also be started from a command line. This allows you to add more parameters to the script as well.
- You can use scripts to execute automated Eplan actions.
- You can use scripts to read out or change settings.
- Scripting also allows you to add new actions to Eplan. In the process a new action can be integrated as a command into the ribbon.
- Scripts can also be written to react to specific Eplan events. A script can even respond to the start or closing of the program.
The command Automated processing (command path: File > Extras > Command group Extensions > Interfaces > Command group Automated processing > Automated processing) also uses scripts. Here you can use some of the available scripts to automate activities in the individual areas of project editing (Back up data, Print, etc.).
Notes:
- In a script you can use all classes of the Microsoft.Net Assemblies System, System.XML, System.Drawing, System.Windows.Forms, the Eplan API Assemblies Eplan.EplApi.Base, Eplan.EplApi.ApplicationFramework, Eplan.EplApi.Gui and Eplan.EplApi.Masterdata as well as the JSON assembly used in Eplan Newtonsoft.JSON.
- You cannot reference additional assemblies in a script(.Net Framework, Eplan or other providers).
See also