Use a Script to Export Graph or Pattern Data

You may use a script to export graph or pattern data to a CSV (comma separated value) file.

Exporting Graph Data

If you want to export graph data from a script, you should use the following general procedure.

Open a Graph tab and add one or more curves that represent what you would like to export.

You may plot any project. It does not need to be the project for which you want to export the data.

Save the graph as a template file.

You may use File > Save As Template or File > Save As.

Use the following command to export a csv file:

sonnet -graph -template mytemplate.sgrx myproject.sonx -csv out.csv

where “sonnet” is the full path to the sonnet executable and mytemplate.sgrx is the name of the graph file you saved in the previous step. This will open the Sonnet GUI (if it is not already open) and save a csv file as out.csv

Exporting Pattern Data

If you want to export far field pattern data from a script, you should use the following general procedure.

Open a Pattern tab and add one or more curves that represent what you would like to export.

You may plot any project. It does not need to be the project for which you want to export the data.

Save the pattern as a template file.

You may use File > Save As Template or File > Save As.

Use the following command to export a csv file:

sonnet -farfield -template mytemplate.sptx myproject.sonx -csv out.csv

where “sonnet” is the full path to the sonnet executable and mytemplate.sptx is the name of the pattern file you saved in the previous step. This will open the Sonnet GUI (if it is not already open) and save a csv file as out.csv.