LocalLauncher#
- class ansys.pyensight.core.LocalLauncher(ansys_installation: str | None = None, application: str | None = 'ensight', batch: bool = True, **kwargs)#
Creates a
Session
instance by launching a local copy of EnSight.This class allows you to launch locally a copy of EnSight that supports the gRPC interface. It creates and binds a
Session
instance to the created gRPC session and returns that instance.- Parameters:
- ansys_installation
str
,optional
Path to the local Ansys installation, including the version directory. The default is
None
, in which case common locations are scanned to detect the latest local Ansys installation. ThePYENSIGHT_ANSYS_INSTALLATION
environmental variable is checked first.- application
str
,optional
App to launch. The default is
ensight
, butenvision
is also an option.- batchbool,
optional
Whether to run EnSight (or EnVision) in batch mode. The default is
True
, in which case the full GUI is not presented.- timeout
float
,optional
Number of seconds to try a gRPC connection before giving up. This parameter is defined on the parent
Launcher
class, where the default is120
.- use_eglbool,
optional
Whether to use EGL hardware for accelerated graphics. The platform must be able to support this hardware. This parameter is defined on the parent
Launcher
class, where the default isFalse
.- use_sos
int
,optional
Number of EnSight servers to use for SOS (Server of Server) mode. This parameter is defined on the parent
Launcher
class, where the default isNone
, in which case SOS mode is not used.- additional_command_line_options: list, optional
Additional command line options to be used to launch EnSight.
- ansys_installation
Examples
>>> from ansys.pyensight.core import LocalLauncher >>> # Create one EnSight session >>> session1 = LocalLauncher(ansys_installation='/ansys_inc/v232').start() >>> # Create a second session (a new LocalLauncher instance is required) >>> session2 = LocalLauncher(ansys_installation='/ansys_inc/v232').start()
Methods
LocalLauncher.close
(session)Shut down the launched EnSight session.
Get the Ansys distribution CEI directory to use.
LocalLauncher.launch_webui
(cpython, ...)Start an EnSight session using the local EnSight installation.
Release any additional resources allocated during launching.
Attributes
Type of app to launch.
Root directory for HTML files.