messaYou can load (and unload) a script in EPLAN. In this case, not the start function is executed, but special functions are registered in EPLAN. You can add a new Action to EPLAN, add menu points to the utilities menu, and register functions to react on EPLAN events.
When a script with the above code is loaded, the function "MyFunctionAsAction" is registered in EPLAN as action by the name "MyScriptAction". Now the new action can be used like any other action in EPLAN. It can e.g. be called by the command line or it can be assigned to a menu point or toolbar button.
Once the script was loaded, it will be automatically loaded during the Startup of EPLAN and the action will again be available.
To unload (unregister) a script, you just call the menu point "Unload" and select the respective script in the dialog: