Retrieve messages from Mechanical

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

Through ACT scripting, how can I retrieve the info, warning and error messages in Mechanical ?

Tagged:

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 732
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓

    The following code can be used:

        listMessages=ExtAPI.Application.Messages
        for message in listMessages:
            print(message.Severity, message.DisplayString)
    

Answers

  • Sameer
    Sameer Member, Employee Posts: 1
    First Anniversary Ansys Employee First Comment

    Hi Pernelle, I want to collect id's of vertices / edges / faces / bodies for each error/ warning message for some automation task. Is it possible to do that ?

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 732
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

    Hi @Sameer , what is collected here is just the string returned by Mechanical, which unfortunately does not show the id number of the offending geometry.