Hello,
I have a very large customer that is experiencing an issue with PyAnsys. The customer is using PyAnsys to open a remote session of work bench, open an existing project in that workbench session, and then remotely open a static structural model from within that workbench project (see below). When using 2024R2, workbench opens as a remote session, but the mechanical GUI is launched. Using the same code in 2025R1, workbench opens as a remote session and mechanical also launches in a remote session (desired behavior).
Why does mechanical open remotely in 2025R1 and not in 2024R2? Is there a work around to launch mechanical remotely in 2024R2 when opening from a workbench project?
2024R2 (opens remote instance of workbench, opens mechanical GUI):
from ansys.tools.path import get_available_ansys_installations
from ansys.workbench.core import launch_workbench
from ansys.mechanical.core import launch_mechanical, close_all_local_instances, connect_to_mechanical
v242 = "C:\Program Files\ANSYS Inc\v242\aisol\bin\winx64\AnsysWBU.exe" # Version Path for Mechanical
wbpj_path = r"C:\Users\msexton\Desktop\Support_Models\Stoke\22.wbpj" # Workbench Model link (Update to your model pathway)
wb = launch_workbench(show_gui=False, version="242") # Launch remote session of workbench in 2024R2
wb.run_script_string(f"""Open(r"{wbpj_path}")""") # Open WB Project
server_port = wb.start_mechanical_server('SYS') # Opens mechanical GUI
2025R1 (opens remote instance of workbench, opens remote instance of mechanical = no GUI):
from ansys.tools.path import get_available_ansys_installations
from ansys.workbench.core import launch_workbench
from ansys.mechanical.core import launch_mechanical, close_all_local_instances, connect_to_mechanical
v251 = "C:\Program Files\ANSYS Inc\v251\aisol\bin\winx64\AnsysWBU.exe" # Version Path for Mechanical
wbpj_path = r"C:\Users\msexton\Desktop\Support_Models\Stoke\22.wbpj" # Workbench Model link (Update to your model pathway)
wb = launch_workbench(show_gui=False, version="251") # Launch remote session of workbench in 2025R1
wb.run_script_string(f"""Open(r"{wbpj_path}")""") # Open WB Project
server_port = wb.start_mechanical_server('SYS') # Opens remote session of mechanical