Tips and Tricks : How to Create and Read an Excel File with Altair Flux ?

lombard
lombard
Altair Employee
edited March 2023 in Altair Exchange

Overview

As engineers, we often like to provide data using tables from Excel. With Altair Flux, you may want to compute the efficiency of electric motors. In this case, it can be interesting to build a table with all losses to create the power balance sheet.

What we propose here is an example of a script, that can be run from Altair Flux to generate an Excel file and then read it. These examples are based on the POI library from Apache in Python, which has been embedded inside Flux.

The first script will create an Excel file (see image). 1_Create_Excel_File_From_Flux_POI_Out_2.py 

image

The second script will open this Excel file and display values in the Flux console (see image 2) 2_Read_Excel_File_From_Flux_POI_Out_2.py 

image

Et voilà !

 

Usage/Installation Instructions

Follow the next steps:

1. Download the 2 script files.

2. Open a Flux project.

3. Select [Project] [Command File] [Run a python file...].

4. Select one of the downloaded files.

Comments

  • Ahmed jasim
    Ahmed jasim New Altair Community Member
    edited December 2023

    Please, how to extract the Excel file for the Flux project?

  • lombard
    lombard
    Altair Employee
    edited December 2023

    Please, how to extract the Excel file for the Flux project?

    Hi,

    After you have displayed a curve, you can follow the next steps to put the result in an Excel file:

    • from the tree, select [Post-processing] [Curve] [2D Curve (I/O Parameter] [name of the curve]
    • right click and select [excel export] in the menu
    • give a name for the excel file to be created and click on [OK] button

    If you are interested in having the main characteristics of your Flux project, you should load ([Project] [Macro] [Load]) and run the macro called [Automatic Report]. The result will be in html or txt format.

    I hope it will help