Connecting with Ansys Workbench#
This guidelines describe step by step how to connect PyWorkbench to Ansys Workbench. Different options exist, including local and remote connections.
Local connection#
You can connect PyWorkbench to a local session of Ansys Workbench by running the following steps:
Start Ansys Workbench
In the Workbench Command Window, type
StartServer()
Take a note of the returned port number
Use the port number to connect PyWorkbench to the server:
from ansys.workbench.core import connect_workbench
workbench = connect_workbench(port=port)
Remote connection#
You can connect PyWorkbench to an Ansys Workbench session running on a remote computer by giving its computer name or IP and the port number that the service uses:
from ansys.workbench.core import connect_workbench
workbench = connect_workbench(host=host_name_or_IP, port=port)