Application
The POSTFEKO application object which is returned by the pf.GetApplication() method.
Example
-- The "GetApplication" function lives in the "pf" namespace and -- returns the current POSTFEKO application object. app = pf.GetApplication() -- Start a new project to ensure the session is clean app:NewProject() -- Open an example file located in the FEKO_HOME folder and cascade the windows app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/Dipole_Example.fek]]) app:CascadeWindows()
Property List
- MSPowerPointInstalled
- A flag indicating if Microsoft PowerPoint is installed on the system. (Read only boolean)
- MSWordInstalled
- A flag indicating if Microsoft Word is installed on the system. (Read only boolean)
- Modified
- True if the current session is modified and needs to be saved. (Read only boolean)
- SessionName
- The session name if it has one. (Read only string)
- SessionPath
- The path of the project file if it has one or the current working directory path. (Read only string)
- Type
- The object type string. (Read only string)
- Version
- The application version. (Read only Version)
Collection List
- CartesianGraphs
- The collection of Cartesian graphs in the project. (CartesianGraphCollection of CartesianGraph.)
- CartesianSurfaceGraphs
- The collection of Cartesian surface graphs in the project. (CartesianSurfaceGraphCollection of CartesianSurfaceGraph.)
- ImportedDataSets
- The collection of imported data sets in the project. (ImportedDataSetCollection of ImportSet.)
- MathScripts
- The collection of math scripts in the project. (MathScriptCollection of MathScript.)
- Models
- The collection of models in the project. (ModelCollection of Model.)
- PolarGraphs
- The collection of Polar graphs in the project. (PolarGraphCollection of PolarGraph.)
- Reports
- The collection of report templates in the project. (ReportsCollection of ReportTemplate.)
- SmithCharts
- The collection of Smith charts in the project. (SmithChartCollection of SmithChart.)
- StoredData
- The collection of stored data in the project. (StoredDataCollection of ResultData.)
- Views
- The collection of 3D model views in the project. (ViewCollection of View.)
- Windows
- The collection of all the 3D model views and 3d graphs in the project. (WindowCollection of Window.)
Method List
- CascadeWindows ()
- Cascade the windows.
- Close ()
- Close the POSTFEKO application.
- CloseAllWindows ()
- Close all windows.
- CreateQuickReport (filename string, type ReportDocumentTypeEnum)
- Create a quick report. (Returns a QuickReport object.)
- ExportAllWindowsAsImages (directory string, fileformat string)
- Export all window images to a specified directory.
- ExportAllWindowsAsImages (directory string, fileformat string, imagewidth number, imageheight number)
- Export all window images to a specified directory.
- ImportResults (filename string, type ImportFileTypeEnum)
- Import results data from a specified file. (Returns a ImportSet object.)
- ImportResults (filenames List of string, type ImportFileTypeEnum)
- Import results data from specified files. (Returns a List of ImportSet object.)
- NewProject ()
- Starts a new project.
- OpenFile (filename string)
- Opens a file.
- Redo ()
- Redo the last model operation.
- ReloadChangedFiles ()
- All models and imported files are compared to the versions that were loaded. If they have changed, they will be reloaded or indicated as modified. The operation happens periodically during an interactive POSTFEKO session but does is not performed automatically during script execution.
- Save ()
- Saves the current session.
- SaveAs (filename string)
- Saves the current session with the given name.
- TileWindows ()
- Tile the windows.
- Undo ()
- Undo the last model operation.
Property Details
- MSPowerPointInstalled
- A flag indicating if Microsoft PowerPoint is installed on the system.
- Type
- boolean
- Access
- Read only
- MSWordInstalled
- A flag indicating if Microsoft Word is installed on the system.
- Type
- boolean
- Access
- Read only
- Modified
- True if the current session is modified and needs to be saved.
- Type
- boolean
- Access
- Read only
- SessionName
- The session name if it has one.
- Type
- string
- Access
- Read only
- SessionPath
- The path of the project file if it has one or the current working directory path.
- Type
- string
- Access
- Read only
- Type
- The object type string.
- Type
- string
- Access
- Read only
- Version
- The application version.
- Type
- Version
- Access
- Read only
Collection Details
- CartesianGraphs
- The collection of Cartesian graphs in the project.
- CartesianSurfaceGraphs
- The collection of Cartesian surface graphs in the project.
- ImportedDataSets
- The collection of imported data sets in the project.
- MathScripts
- The collection of math scripts in the project.
- Models
- The collection of models in the project.
- Type
- ModelCollection
- PolarGraphs
- The collection of Polar graphs in the project.
- Reports
- The collection of report templates in the project.
- SmithCharts
- The collection of Smith charts in the project.
- StoredData
- The collection of stored data in the project.
- Views
- The collection of 3D model views in the project.
- Type
- ViewCollection
- Windows
- The collection of all the 3D model views and 3d graphs in the project.
- Type
- WindowCollection
Method Details
- CascadeWindows ()
- Cascade the windows.
- Close ()
- Close the POSTFEKO application.
- CloseAllWindows ()
- Close all windows.
- CreateQuickReport (filename string, type ReportDocumentTypeEnum)
- Create a quick report.
- Input Parameters
- filename(string)
- The filename of the quick report to generate.
- type(ReportDocumentTypeEnum)
- The document type specified by the ReportDocumentTypeEnum, e.g. PDF, MSWord or MSPowerPoint.
- Return
- QuickReport
- The quick report to generate.
- Example
app = pf.GetApplication() app:NewProject() app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.pfs]]) -- Create a PDF quick report (called exampleReport.pdf) and give it a heading report = app:CreateQuickReport([[temp_exampleReport1]], pf.Enums.ReportDocumentTypeEnum.PDF) report.DocumentHeading = "Example report" -- Exclude the cartesian graph window report:SetPageIncluded("Cartesian graph1", false) -- Generate the document report:Generate()
- ExportAllWindowsAsImages (directory string, fileformat string)
- Export all window images to a specified directory.
- ExportAllWindowsAsImages (directory string, fileformat string, imagewidth number, imageheight number)
- Export all window images to a specified directory.
- ImportResults (filename string, type ImportFileTypeEnum)
- Import results data from a specified file.
- Input Parameters
- filename(string)
- The name of the file to import.
- type(ImportFileTypeEnum)
- The data type of the file to import specified by the ImportFileTypeEnum, e.g. FEKOFarField, FEKOMagneticNearField, Touchstone, etc.
- Return
- ImportSet
- The import set containing the imported result data.
- Example
app = pf.GetApplication() app:NewProject() app:OpenFile(FEKO_HOME..[[/shared/Resources/Automation/startup.fek]]) nearField = app.Models[1].Configurations[1].NearFields[1] fileName = "temp_nearField" nearField:ExportData(fileName, pf.Enums.NearFieldsExportTypeEnum.Electric, 51) -- Import the near field results that have just been exported importSet = app:ImportResults(fileName..".efe",pf.Enums.ImportFileTypeEnum.FEKOElectricNearField) -- Compare the original and imported near fields view = app.Views[1] view.Plots:Add(nearField) viewCopy = view:Duplicate() viewCopy.Plots:Add(importSet.ImportedData[1]) app:TileWindows()
- ImportResults (filenames List of string, type ImportFileTypeEnum)
- Import results data from specified files.
- Input Parameters
- filenames(List of string)
- The names of the files to import (List of string).
- type(ImportFileTypeEnum)
- The data type of the file to import specified by the ImportFileTypeEnum, e.g. FEKOFarField, FEKOMagneticNearField, Touchstone, etc.
- Return
- NewProject ()
- Starts a new project.
- OpenFile (filename string)
- Opens a file.
- Input Parameters
- filename(string)
- The name of the file to open.
- Redo ()
- Redo the last model operation.
- ReloadChangedFiles ()
- All models and imported files are compared to the versions that were loaded. If they have changed, they will be reloaded or indicated as modified. The operation happens periodically during an interactive POSTFEKO session but does is not performed automatically during script execution.
- Save ()
- Saves the current session.
- SaveAs (filename string)
- Saves the current session with the given name.
- Input Parameters
- filename(string)
- The name of the pfs file.
- TileWindows ()
- Tile the windows.
- Undo ()
- Undo the last model operation.