How can I export optiSLang plot data into csv files?

Member, Employee Posts: 16
Second Anniversary 5 Likes Name Dropper First Comment
✭✭✭

How can I programmatically export ANSYS optiSLang plot data
Residual Plot
into a CSV files?
Export to CSV

Best Answer

  • Member, Employee Posts: 16
    Second Anniversary 5 Likes Name Dropper First Comment
    ✭✭✭
    Answer ✓

    ANSYS optiSLang postprocessing scripting API can be used to automate optiSLang's postprocessing.

    Using the following script will extract all response data points and their approximated values:

    1. from py_monitoring_kernel import *
    2. from py_monitoring_gui import *
    3.  
    4. residual_plot = Visuals.Residual( Id(Visuals.Residual.get_display_name()), data_id )
    5. control_container.add_control( residual_plot, True, RELATIVE_POSITIONING, 1/2., 0, 1/2., 1/2., Visuals.Residual.get_group_name() )
    6.  
    7. mon_data=controller.get_monitoring_data(data_id)
    8. response_names=mon_data.get_response_names()
    9.  
    10. for response in response_names :
    11. Convenience.set_response_to_3rd_axis( controller, data_id, response )
    12. control_container.flush()
    13.  
    14. residual_plot.export_data( response + "_data.csv" )
    15.  
    16. #close pp after work is done ?
    17. control_container.close()
    18.  

    Script can be triggered from inside ANSYS optiSLang PostProcessing:
    oSLPP: run script
    or inside ANSYS optiSLang project:
    oSL:Custom Script

Welcome!

It looks like you're new here. Sign in or register to get started.