Is there a way to export a Far Field generated by a math script using Lua?

Israel Lopez
Israel Lopez Altair Community Member
edited February 2021 in Community Q&A

Hello,

I’m trying to export a Far Field that was previously generated by a Far Field Math script.

The manual has this entry:

farFieldData = app.Models[1].Configurations[1].FarFields["FarFields"]  farFieldData:ExportData("temp_farFieldExport",pf.Enums.FarFieldsExportTypeEnum.Directivity,51)

 

 I was not able to find something similar for the Math Scripts.

My code: 

farFieldData = app.MathScripts[1]  farFieldData:ExportData("temp_farFieldExport",pf.Enums.FarFieldsExportTypeEnum.Directivity,51)

 

 Looks like the method does not exist.

I’m getting the error:

Attempt to call method ‘ExportData’ (a nil value)

 

Is there a way to export the Far Field?

Of course I can do it directly from PostFEKO, but I’d like to do it in a script.

Thanks

Tagged:

Answers

  • Madelé van der Merwe_21115
    Madelé van der Merwe_21115
    Altair Employee
    edited February 2021

    Hello @Israel Lopez 

    You should be able to do this with a script by referencing the math script as you did, then first storing the data before exporting.

    farFieldData = app.MathScripts[1] storedData = farFieldData:StoreData() storedData:ExportData("temp_farFieldExport",pf.Enums.FarFieldsExportTypeEnum.Directivity,51) storedData:Delete()

    Kind regards

    Madelé

  • Israel Lopez
    Israel Lopez Altair Community Member
    edited February 2021

    Hello @Israel Lopez 

    You should be able to do this with a script by referencing the math script as you did, then first storing the data before exporting.

    farFieldData = app.MathScripts[1] storedData = farFieldData:StoreData() storedData:ExportData("temp_farFieldExport",pf.Enums.FarFieldsExportTypeEnum.Directivity,51) storedData:Delete()

    Kind regards

    Madelé

    Thanks Madelé

    It worked just fine

  • Madelé van der Merwe_21115
    Madelé van der Merwe_21115
    Altair Employee
    edited February 2021

    Thanks Madelé

    It worked just fine

    Thanks for the feedback. I'm glad to hear that it worked!