Retrieve parameters and values

Options
Pernelle Marone-Hitz
Pernelle Marone-Hitz Member, Moderator, Employee Posts: 827
First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
edited November 2023 in Structures

Is it possible to retrieve information on the parameters defined in the Parameter Set of a WB project schematic?

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 827
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    edited November 2023
    Options

    This script will work from the WB project schematic.

    parameter_list = Parameters.GetAllParameters() # retrieve all parameters
    input_parameter_list = [item for item in parameter_list if item.Usage =='Input'] # work only with input parameters
    for index,value in enumerate(input_parameter_list):
        try:
            print(input_parameter_list[index].Name)
            print(input_parameter_list[index].DisplayText)
            print(input_parameter_list[index].Expression)
            print(input_parameter_list[index].Value.Value)
            print(input_parameter_list[index].Value.Unit)
        except:
            print(input_parameter_list[index].Name)
            print(input_parameter_list[index].DisplayText)
            print(input_parameter_list[index].Expression)
            print(input_parameter_list[index].Value)
            print('NA')