Skip to content

Introduction

Scripting refers to the possibility of executing individual commands or program code in EPLAN. This is done via the so-called API (Application Programming Interface). Behind the EPLAN API are all the functions that are available in the platform (Electric P8, Fluid, Pro-Panel, etc.). These programs are all based on the same program code and are therefore compatible with each other. The various applications contain similar or identical functions, e.g. you can create labels in both Fluid and Electric P8. The only difference is the content.

These sequences are called Actions in EPLAN. The section "Executing actions" is dedicated to these, as there are several ways of executing such actions. The word scripting usually only refers to scripts that can be used in every EPLAN expansion stage (license). To be able to execute further commands or functions, the EPLAN API module is required.

What are scripts?

Scripts are small program codes. In EPLAN, these can be created in two programming languages:

  • Microsoft C# (C-Sharp)

  • Microsoft VB.NET (Visual Basic.NET)

Only examples in C# are provided in the following chapters, as EPLAN generates finished code with this language and therefore provides an optimum template. A script cannot be executed on its own. It must be started in conjunction with EPLAN.

What can scripts do?

Scripts can do a lot, but not everything. EPLAN provides a range of commands, but restricts them to a manageable range. This makes it much easier for users to get started. This also ensures that no unwanted actions, e.g. on the project, are executed.

We all know the recurring task of outputting labels. Several exports are necessary for each project. Each time, the labeling scheme must be selected anew, the folder must also be named and a file name assigned. With a script, we can combine all these steps and place them on a button in the ribbon, for example. We can also use this function to create several labels one after the other. The PDF export can also be automated. For example, would you like to automatically generate a PDF to track changes when the project is closed? This can be easily realized with a script. Do you need interfaces in the company to use information outside of EPLAN, e.g. in the ERP system? No problem at all! The scripting options make this possible at the touch of a button. It is often necessary to switch back and forth between different settings. Searching through the countless settings in EPLAN is tedious. Instead, we write a script for the configurations and do this in the project planning.

This is a small list of the possibilities that can be realized with scripts:

  • Automate labeling
  • PDF export
  • Backup
  • Create your own tabs in the ribbon
  • Create graphical forms, e.g. with buttons, checkboxes and selection dialogs
  • Change properties
    • Project properties
    • Page properties
  • Settings
    • Reading
    • Write settings
  • Change article data

These are by no means all the functions. Even more functions can be added by expanding the program code.

Difference Scripting & API

To make the difference a little clearer, you will find a small list of the most important features of the API module in EPLAN below:

  • Access to the complete EPLAN data model
  • Easier reading of objects
  • Access to more objects
  • Direct access to project properties/project settings
  • More available actions