In order to make the EPLAN 21 API applicable for languages beyond C/C++, a COM version of the API is registered with EPLAN. This COM interface offers the same functionalities as the C-based API, they are however slightly modified. The basic concepts of the C-API (sessions, handles, commands etc.) also apply to the COM-API. The differences are as follows:
By means of the COM interface all programming languages provided with an integrated COM support can access EPLAN 21 databases. These languages include (inter alia):
Using these languages, it is e.g. possible to open and edit EPLAN 21 databases in MS Excel or MS Word.
There is the possibility to write add-ins in Visual Basic and to integrate them in EPLAN 21. To do so, generate an ActiveX DLL in Visual Basic, and implement the IEplanAddIn interface in a class. To this end, the EplApi type library must be added to the project. In the IEplanAddIn_initialize() process it is then possible to register menus and commands as usually. In order to register the add-in the class name of the ActiveX component (e.g. "Project1.Class1") must be entered in the administration dialog as add-in.
You can only write add-ins in Visual Basic to a certain extent, as it is not possible to debug add-ins within EPLAN 21. Only Visual C++ (!) permits to examine such Visual Basic add-ins. To get a description please refer to the Microsoft Knowledge Base [external link]. You can find an example of a Visual Basic add-in in the Callbacks & Notifications section.
The Script Editor integrated in EPLAN 21 makes it possible to create and execute scripts in VB Script or JavaScript. Menu items, which can call up scripts, can also be registered in EPLAN 21 via the menu management. For more information, please refer to the EPLAN 21 documentation.
When using the COM API with a script language please note that the constants defined in the API cannot be used due to the fact that Microsoft Script Control does not support constants. Instead of the constants (error codes, iterator types etc.) the corresponding numerical value must be given to the functions of the API.