Jump to content
Meerten

Exporting plot with API

Recommended Posts

Hi,

 

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,

Meerten

Lua_example_post.lua

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.

ExportTraces

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)
end

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

×
×
  • Create New...