In Mechanical scripting, how can I get the current solver directory (dpXX/SYS/Mech)?

Landon Mitchell Kanner
Landon Mitchell Kanner Member, Employee Posts: 178
First Answer First Comment 5 Likes First Anniversary
edited June 2023 in Structures

I am using Mechanical scripting and would like to get the path to the solver directory for a given analysis. I want to know the location that is opened if I right click on the analysis branch and click 'Open Solver Files Directory".

Best Answer

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 178
    First Answer First Comment 5 Likes First Anniversary
    edited March 2023 Answer ✓

    For demo purposes let's get the working directory for the first analysis:

    first_analysis = ExtAPI.DataModel.Project.Model.Analyses[0] 
    solver_directory = first_analysis.WorkingDir
    

    Note: During solution the solver directory will change to a temporary directory.

Answers