How to plot the values of a variable used in a script?

Category:
Scripting
Answer

In order to plot values of a variable that was used in a DPL or Python script you first need to save the variable's values into a result file (ElmRes).

For this define a result parameter on the "Result" page of your script object and add it as recording variable to your result file:

ElmRes.AddVariable(this, 'b:variableValuesToPlot');

After this is done values have to be assigned to the variable 'variableValuesToPlot'.

for(d = 0; d <= 1; d += 0.1) {
this:variableValuesToPlot = 0.5*d;
res.Write();

}

After the result file 'res' has been filled, it can be used for plotting.

Refer to attached pfd file

Tags
Back