This functionality is only available for certain module packages.

You are here: EEC > ECAD > Generating project documents > Executing C# scripts in P8

Executing C# scripts in P8

After the generation of P8 projects, the execution of a C# script in P8 can optionally be initiated.

A parameter with the absolute path to the C# script must exist in order to execute a script. The path has to be specified with double backslashes, for example =c:\\scripts\\ecad\\myP8Script.cs.

A further parameter can optionally be specified that contains a map with the arguments that are transferred to the C# script when called.

The project components of the WiringDiagram type have to contain these parameters.

The names of these parameters are Script and ScriptArguments by default. Any names deviating from these are to be entered in the model variables.

The C# script for EPLAN Electric P8 must contain a method that is identified by the [Start] attribute. The name of the method can be anything.

Currently, the data types string and int are supported for the arguments of the Start method. The order of the arguments does not have to be followed, because the assignment will be realized via the parameter names.

The refreshFS parameter can optionally be specified in a C# script. If the value of the parameter is true, the internal file system of the EEC will be synchronized after execution of the script.

See also:

More: