Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

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

ANSYS command line – running python script

    • Jett22
      Subscriber

      Hi everyone,

      I am trying to start a python script in ANSYS Workbench from Windows Command Prompt. This script has python commands which has an automation scheme in it. I am having slight issues with how to do this. Once in Workbench I do: File-->Scripting-->Run Script File...-->(change the file type to python)-->(then select my automation python script) Can someone please explain how to do this?

      So far I am entering this into cmd: “C:\Program Files\ANSYS Inc\v231\Framework\bin\Win64\RunWB2.exe” -r "C:\Users\jett\Desktop\ANSYStest1\BasicV2\WorkingProject.py"

      I am getting a fatal error. Is there a more specific way to do this?

      Thanks in advance

    • Aniket Chavan
      Forum Moderator

      C:\Program Files\ANSYS Inc\V231\Framework\bin\win64\runwb2 -R workbenchscriptfile -I  should be the way of doing it if you want to your script interactively from the command prompt.

      https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v232/en/wb2_js/wb2js_cmdlineexec.html

      Does the workingproject.py script work when you run it from file>scripting>Run script file? If yes, try checking the file path for the script and see if the autocompletion feature helps to navigate to the correct path.

      -Aniket

      Forum Rules & Guidelines

    • ErKo
      Ansys Employee

      Duplicate discussion- use the other discussion as it is related to cfx.

      /forum/forums/topic/running-journal-python-file-form-the-command-line-ansys-cfx/#post-309990

      Closing here (please do not create multiple discussions of the same topic)

      Erik

Viewing 2 reply threads
  • The topic ‘ANSYS command line – running python script’ is closed to new replies.
[bingo_chatbox]