MathScriptCollection

A collection of math scripts.

Example

app = pf.GetApplication()
app:NewProject()
app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/CustomDataSession.pfs]])

    -- Add the first math script to a Cartesian graph
    
graph = app.CartesianGraphs:Add()
mathScriptTrace1 = graph.Traces:Add(app.MathScripts[1]) -- Index method
mathScriptTrace2 = graph.Traces:Add(app.MathScripts["CustomMath1"]) -- Name method

    -- Add all the far fields in the collection to the 3D view

for index, mathScriptData in pairs(app.MathScripts) do
    mathScriptPlot = app.Views[1].Plots:Add(mathScriptData)
end

Usage locations

The MathScriptCollection object can be accessed from the following locations:

Property List

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

Method List

Add (type MathScriptTypeEnum)
Adds a new math script to the collection. (Returns a MathScript object.)
Contains (label string)
Checks if the collection contains an item with the given label. (Returns a boolean object.)
Item (index number)
Returns the MathScript at the given index. (Returns a MathScript object.)
Item (label string)
Returns the MathScript with the given label. (Returns a MathScript object.)
Items ()
Returns a table of MathScript. (Returns a List of MathScript 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 MathScript at the given index in the collection. (Read MathScript)
[string]
Returns the MathScript with the given name in the collection. (Read MathScript)

Property Details

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

Method Details

Add (type MathScriptTypeEnum)
Adds a new math script to the collection.
Input Parameters
type(MathScriptTypeEnum)
The type of math script specified by MathScriptTypeEnum, e.g. FarField, NearField, Custom, etc.
Return
MathScript
The new math script.
Contains (label string)
Checks if the collection contains an item with the given label.
Input Parameters
label(string)
The label of the MathScript.
Return
boolean
The success of the check.
Item (index number)
Returns the MathScript at the given index.
Input Parameters
index(number)
The index of the MathScript.
Return
MathScript
The MathScript at the given index.
Item (label string)
Returns the MathScript with the given label.
Input Parameters
label(string)
The label of the MathScript.
Return
MathScript
The MathScript with the given label.
Items ()
Returns a table of MathScript.
Return
List of MathScript
A table of MathScript.
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 MathScript.