Using ACT, how can I read a result file in Mechanical (similarly to Tools / Read result file) and sp

Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
100 Answers 500 Comments 250 Likes First Anniversary
✭✭✭✭
edited June 2023 in Structures

Using ACT, how can I read a result file in Mechanical (similarly to Tools / Read result file) and specify the unit system that was used for the solve?

Tagged:

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭
    Answer ✓

    The following line script can be used and adapted:

    Solu=ExtAPI.DataModel.Project.Model.Analyses[0].Solution 
    settings=ExtAPI.DataModel.Project.Model.Analyses[0].AnalysisSettings  
    sfd=settings.SolverFilesDirectory 
    Solu.ReadGivenAnsysResultFile(sfd+"file.rst", Ansys.ACT.Automation.Mechanical.Enums.UnitSystemIDType.UnitsMKS)  
    

    Depending on the version used, the last line can also be:

    Solu.ReadGivenAnsysResultFile(fName, UnitSystemIDType.UnitsUMKS)
    

Answers

  • Erik Kostson
    Erik Kostson Member, Moderator, Employee Posts: 276
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭

    Sometimes this can lag a bit - the below seems a bit faster:

    solution.ReadGivenAnsysResultFileByReference()

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 210
    100 Comments 25 Answers Second Anniversary 25 Likes
    ✭✭✭✭

    Just for reference, the option to access Unit system has changed. Please use the below.

    analysis.Solution.ReadGivenAnsysResultFile(filepath,Ansys.Mechanical.DataModel.Enums.UnitSystemIDType.UnitsNMM)