# Pulling Data Into the Math Scripting Environment

A common use for the scripting functionality is to modify existing POSTFEKO results.

As such, it is necessary to get a handle on a result, defined as a DataSet, into the scripting environment. For example, to get a handle on either of the near fields in a session, the key string is used in conjunction with the GetDataSet function. The key string is in the format:

"[Model].[Configuration].[Request Name]"

The following code prints a list of all near field results in the session. The name of the near field contained in the Horn model is used to get a handle on the result, which is returned without any further processing. The result can be displayed in POSTFEKO for further visualisation.

names = pf.NearField.GetNames()
printlist(names)
nearfield = pf.NearField.GetDataSet("Horn.StandardConfiguration1.NearFields")
return nearfield

1: "Horn.StandardConfiguration1.NearField1"
2: "startup.Configuration1.NearFields"

To create a near field math script.

1. Open the Horn.fek file in POSTFEKO
2. On the Home tab, in the Scripting group, click the New script icon. From the drop-down list select the Near field icon.
3. Modify the code (optional).
4. Click on the Run script icon.