How to get all Component or Named Selection Names from an MAPDL results file: DPF

Member, Employee Posts: 385
25 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭

How can I get a list of the components defined in the results file through DPF in Mechanical?

Tagged:

Best Answer

  • Member, Moderator, Employee Posts: 873
    100 Answers 500 Comments 250 Likes Second Anniversary
    ✭✭✭✭
    Answer ✓
    1. import mech_dpf
    2. import Ans.DataProcessing as dpf
    3. mech_dpf.setExtAPI(ExtAPI)
    4. #Get path to result file
    5. analysis = ExtAPI.DataModel.Project.Model.Analyses[0]
    6. filepath = analysis.ResultFileName
    7. #Data sources
    8. dataSources = dpf.DataSources()
    9. dataSources.SetResultFilePath(filepath)
    10. # Model
    11. model=dpf.Model(dataSources)
    12. print(model.AvailableNamedSelections)

Welcome!

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