Is there API name for the variables created from APDL

Valentyn Barannik
Valentyn Barannik Member Posts: 2 **

Hello Team,

We automatically read input and outputs from Ansys Mechanical project. everything worked well till we decided to estimate some results based on APDL script. For some reason the APIname is absent for APDL variable added to project tree (see the attached pictures)
Or may be we are doing creating of APDL variable incorrectly?

Answers

  • Landon Mitchell Kanner
    Landon Mitchell Kanner Member, Employee Posts: 291
    25 Answers 100 Comments 25 Likes First Anniversary
    ✭✭✭✭

    I don't think there is a direct APIName for the output parameters, because they are dependent on the APDL code. Typically, you would access them from a list:

    solution0 = ExtAPI.DataModel.Project.Model.Analyses[0].Solution
    apdl_command0 = solution0.GetChildren[Ansys.ACT.Automation.Mechanical.CommandSnippet](True)[0]
    output0 = apdl_command0.OutputParameters[0]
    variable_name = output0.Name
    value = output0.Value
    print variable_name , ' = ', value
    
  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

    This is a duplicate of PyMechanical Issue #604