ResultTraceCollection

A collection of 2D graph traces.

Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]])
app.Views[1]:Close()

    -- Add a Cartesian graph to the application's collection and obtain
    -- the trace collection

graph = app.CartesianGraphs:Add()
traces = graph.Traces

    -- Add multiple traces to the graph

traces:Add(app.Models[1].Configurations[1].FarFields[1])
traces:Add(app.Models[1].Configurations[1].FarFieldPowerIntegrals[1])
traces:Add(app.Models[1].Configurations[1].Power[1])
traces:Add(app.Models[1].Configurations[1].NearFields[1])

    -- Print a list of all the traces
    
print("Traces on the graph:")
printlist(traces)

    -- Remove two of the graphs, by name and index
    
traces["FarFields_1"]:Delete()
traces[1]:Delete()
    

Usage locations (collections)

The following objects contain the ResultTraceCollection collection:

Property List

Count
The number of ResultTrace items in the collection. (Read only number)
Type
The object type string. (Read only string)

Method List

Add (result ResultData)
Adds a result to a graph. (Returns a ResultPlot object.)
Contains (label string)
Checks if the collection contains an item with the given label. (Returns a boolean object.)
Item (index number)
Returns the ResultTrace at the given index. (Returns a ResultTrace object.)
Item (label string)
Returns the ResultTrace with the given label. (Returns a ResultTrace object.)
Items ()
Returns a table of ResultTrace. (Returns a List of ResultTrace object.)
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated. (Returns a boolean object.)

Index List

[number]
Returns the ResultTrace at the given index in the collection. (Read ResultTrace)
[string]
Returns the ResultTrace with the given name in the collection. (Read ResultTrace)

Property Details

Count
The number of ResultTrace items in the collection.
Type
number
Access
Read only
Type
The object type string.
Type
string
Access
Read only

Method Details

Add (result ResultData)
Adds a result to a graph.
Input Parameters
result(ResultData)
The result to add to the graph.
Return
ResultPlot
The trace on the graph.
Contains (label string)
Checks if the collection contains an item with the given label.
Input Parameters
label(string)
The label of the ResultTrace.
Return
boolean
The success of the check.
Item (index number)
Returns the ResultTrace at the given index.
Input Parameters
index(number)
The index of the ResultTrace.
Return
ResultTrace
The ResultTrace at the given index.
Item (label string)
Returns the ResultTrace with the given label.
Input Parameters
label(string)
The label of the ResultTrace.
Return
ResultTrace
The ResultTrace with the given label.
Items ()
Returns a table of ResultTrace.
Return
List of ResultTrace
A table of ResultTrace.
UniqueName (label string)
Generates a unique name base of of the provided base name.If the base name already exists in the collection, a digit will be appended until a valid name is generated.
Input Parameters
label(string)
The base name.
Return
boolean
The generated unique name label for ResultTrace.