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

Landon Mitchell Kanner
Landon Mitchell Kanner Member, Employee, GitHub-issue-creator Posts: 315
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
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, GitHub-issue-creator Posts: 315
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    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