Jump to content

Exporting plot with API

Recommended Posts



I have plotted data in POSTFEKO with API scripting, but I do not know how I can export each graph as a .dat file. Can someone help me with that? And is there a macro recording option for POSTFEKO, because I could not find it. Thanks in advance!


With kind regards,



Share this post

Link to post
Share on other sites

Hello Meerten,


The Graph object has a method to export traces. Below is an extract from the documentation.


Export the graph traces to the specified tab separated file.

  • Input Parameters
    • filename(string): The name of the exported data file without its extension.
    • samples(number): The number of samples for continuous data. This value will be ignored if the first trace on the graph is discrete.


If you want to loop over all the graphs and export the traces to .dat files, I suggest that you create a FOR loop and loop over all the graph collections that you want to export and then export use the method above. It will be something like the code below:

app = pf.GetApplication()
for ii = 1, app.CartesianGraphs.Count do
  	local graph = app.CartesianGraphs[ii]
    graph:ExportImage("Cartesian_Graph"..index, 100)

This is just for Cartesian graphs. You will need a similar loop for other graph types that you want to export (polar, Smith, etc.)


Note that I didn't test the code. ;)

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...