General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Suppressing error pop-ups using ansys workbench python script

    • Jett22
      Subscriber

      Hello!

      I have been developing python scripts which automate some routines within ansys workbench. I usually initialize the scripts through the command line. Sometimes random error messages pop up during startup, which I manually dismiss, and the automation script continues to work as expected. Is there a python macro command that does the following to fix this issue:

      if: an error message pops up

            *click "okay" to dismiss the message prompt*

      end 

      Thank you for any help!

      Jett

    • Aniket
      Forum Moderator

      Can you please give example of such errors? if you can give some details about your workflow along with that will be helpful too.

      -Aniket

      Forum Rules & Guidelines

    • Jett22
      Subscriber

      Hi Aniket!

      The errors are mostly GUI errors or just Project schematic errors when ANSYS originally opens. For example, a common error is: "Unexpected error while refreshing pane ProjectSchematic: Exception has been thrown by the target of an invocation." 99% of the time I supress these random errors and the automation works as expected.

      I initialize these Automation scripts from the command line. The automation workflow is usually editing a parameter set and running all unsolved design points.

      All I am looking for is the Macro that does: 

      if: an error message pops up

            *click "okay" to dismiss the message prompt*

      end 

      I have tried to record a script but I cannot create an error to create the script it if that makes any sense

      Thank you

      Jett

    • mjmiddle
      Ansys Employee

      No, you cannot supress popup windows, but you can launch workbench in batch, so there is no GUI displayed:

      "ANSYS Inc\v232\Framework\bin\Win64\RunWB2.exe" -B -R my_script.py
      Using the -R or -E argument will force it to run in batch mode even without -B.

      "ANSYS Inc\v232\Framework\bin\Win64\runwb2.bat" -R my_script.txt

      But you should be more concerned why you are getting error messages. Try deleting or renaming the Ansys cache while workbench is closed to reset all settings:

      %APPDATA%\Ansys

      You may have something wrong with your Ansys installation, or you are launching a network installation and do not have good network connectivity.

Viewing 3 reply threads
  • The topic ‘Suppressing error pop-ups using ansys workbench python script’ is closed to new replies.