How to export table data to csv file in Python environment

sunyroy
sunyroy Member Posts: 11
First Comment Name Dropper
**


When I run this code in visual studio, it prompts "NameError: name 'MechanicalPanelEnum' is not defined". Is there any way to export this data in Python 3.9 environment?

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 327
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    edited December 2024

    You probably need to use the full path:
    ExtAPI.UserInterface.GetPane(Ansys.ACT.Interfaces.Mechanical.MechanicalPanelEnum.TabularData)

    But I think you will also need to switch from using embedded PyMechanical to using remote PyMechanical, as you will need to have the GUI running (although you could hide it). Here is a handy reference guide:

    https://cheatsheets.docs.pyansys.com/pymechanical_cheat_sheet.png