We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
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
      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

    • Erik Kostson
      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.