diff --git a/src/ansys/pyensight/core/locallauncher.py b/src/ansys/pyensight/core/locallauncher.py index 59f9765725d..30ea08a285b 100644 --- a/src/ansys/pyensight/core/locallauncher.py +++ b/src/ansys/pyensight/core/locallauncher.py @@ -131,7 +131,8 @@ def start(self) -> "pyensight.Session": # Launch EnSight # create the environmental variables local_env = os.environ.copy() - local_env["ENSIGHT_SECURITY_TOKEN"] = self._secret_key + if not local_env.get("ENSIGHT_GRPC_DISABLE_SECURITY_TOKEN"): + local_env["ENSIGHT_SECURITY_TOKEN"] = self._secret_key local_env["WEBSOCKETSERVER_SECURITY_TOKEN"] = self._secret_key local_env["ENSIGHT_SESSION_TEMPDIR"] = self.session_directory # If for some reason, the ENSIGHT_ANSYS_LAUNCH is set previously, diff --git a/src/ansys/pyensight/core/session.py b/src/ansys/pyensight/core/session.py index 82047186517..0a6d8fc538e 100644 --- a/src/ansys/pyensight/core/session.py +++ b/src/ansys/pyensight/core/session.py @@ -962,6 +962,10 @@ def _build_utils_interface(self) -> None: # Warn on import errors print(f"Error loading ensight.utils from: '{_filename}' : {e}") + MONITOR_NEW_TIMESTEPS_OFF = "off" + MONITOR_NEW_TIMESTEPS_STAY_AT_CURRENT = "stay_at_current" + MONITOR_NEW_TIMESTEPS_JUMP_TO_END = "jump_to_end" + def load_data( self, data_file: str, @@ -970,6 +974,7 @@ def load_data( reader_options: Optional[dict] = None, new_case: bool = False, representation: str = "3D_feature_2D_full", + monitor_new_timesteps: str = MONITOR_NEW_TIMESTEPS_OFF, ) -> None: """Load a dataset into the EnSight instance. @@ -995,6 +1000,10 @@ def load_data( representation : str, optional Default representation for the parts loaded. The default is ``"3D_feature_2D_full"``. + monitor_new_timesteps: str, optional + Defaulted to off, if changed EnSight will monitor for new timesteps. + The allowed values are MONITOR_NEW_TIMESTEPS_OFF, MONITOR_NEW_TIMESTEPS_STAY_AT_CURRENT + and MONITOR_NEW_TIMESTEPS_JUMP_TO_END Raises ------ @@ -1074,7 +1083,7 @@ def load_data( if result_file: cmds.append(f'ensight.data.result(r"""{result_file}""")') cmds.append("ensight.data.shift_time(1.000000, 0.000000, 0.000000)") - cmds.append('ensight.solution_time.monitor_for_new_steps("off")') + cmds.append(f'ensight.solution_time.monitor_for_new_steps("{monitor_new_timesteps}")') cmds.append(f'ensight.data.replace(r"""{data_file}""")') for cmd in cmds: if self.cmd(cmd) != 0: