diff --git a/src/ansys/pyensight/core/dockerlauncher.py b/src/ansys/pyensight/core/dockerlauncher.py index 47fa01d8bd4..775372cc998 100644 --- a/src/ansys/pyensight/core/dockerlauncher.py +++ b/src/ansys/pyensight/core/dockerlauncher.py @@ -87,6 +87,9 @@ class DockerLauncher(Launcher): Number of EnSight servers to use for SOS (Server of Server) mode. This parameter is defined on the parent ``Launcher`` class, where the default is ``None``, in which case SOS mode is not used. + additional_command_line_options: list, optional + Additional command line options to be used to launch EnSight. + Arguments that contain spaces are not supported. Examples -------- @@ -504,6 +507,9 @@ def connect(self): vnc_url = "vnc://%%3Frfb_port=1999%%26use_auth=0" ensight_args += " -vnc " + vnc_url + if self._additional_command_line_options: + ensight_args += " " + ensight_args += " ".join(self._additional_command_line_options) logging.debug(f"Starting EnSight with args: {ensight_args}\n") ret = self._enshell.start_ensight(ensight_args, ensight_env_vars) diff --git a/src/ansys/pyensight/core/launcher.py b/src/ansys/pyensight/core/launcher.py index 733d28c39c5..f3ecd0bafb1 100644 --- a/src/ansys/pyensight/core/launcher.py +++ b/src/ansys/pyensight/core/launcher.py @@ -59,7 +59,10 @@ class Launcher: enable_rest_api : bool, optional Whether to enable the EnSight REST API. The default is ``False``. This parameter is supported in EnSight 2024 R1 and later. - + additional_command_line_options: list, optional + Additional command line options to be used to launch EnSight. + Please note, when using DockerLauncher, arguments that contain spaces + are not supported. """ def __init__( @@ -68,6 +71,7 @@ def __init__( use_egl: bool = False, use_sos: Optional[int] = None, enable_rest_api: bool = False, + additional_command_line_options: Optional[List] = None, ) -> None: self._timeout = timeout self._use_egl_param_val: bool = use_egl @@ -87,6 +91,7 @@ def __init__( self._egl_env_val = False # a dict of any optional launcher specific query parameters for URLs self._query_parameters: Dict[str, str] = {} + self._additional_command_line_options = additional_command_line_options @property def session_directory(self) -> str: diff --git a/src/ansys/pyensight/core/locallauncher.py b/src/ansys/pyensight/core/locallauncher.py index b856161b247..2c9b9d8e098 100644 --- a/src/ansys/pyensight/core/locallauncher.py +++ b/src/ansys/pyensight/core/locallauncher.py @@ -56,6 +56,8 @@ class LocalLauncher(Launcher): Number of EnSight servers to use for SOS (Server of Server) mode. This parameter is defined on the parent ``Launcher`` class, where the default is ``None``, in which case SOS mode is not used. + additional_command_line_options: list, optional + Additional command line options to be used to launch EnSight. Examples -------- @@ -154,6 +156,8 @@ def start(self) -> "pyensight.Session": vnc_url = f"vnc://%%3Frfb_port={self._ports[1]}%%26use_auth=0" cmd.extend(["-vnc", vnc_url]) cmd.extend(["-ports", str(self._ports[4])]) + if self._additional_command_line_options: + cmd.extend(self._additional_command_line_options) use_egl = self._use_egl()