LicenseManager
#
- class ansys.mechanical.core.embedding.license_manager.LicenseManager(app)#
Class to manage licenses in Ansys Mechanical.
This class provides methods to enable, disable, and check the status of licenses. It also allows for moving licenses to specific indices in the license preference list. It is initialized with an instance of the Ansys Mechanical application.
Overview#
Return list of all licenses. |
|
Return status of the specific license. |
|
Set the status of a license and save the preference. |
|
Print all active licenses. |
|
Disable active license for current session. |
|
Enable license(s) for the current session. |
|
Move a license preference. |
|
Reset the license preference. |
Import detail#
from ansys.mechanical.core.embedding.license_manager import LicenseManager
Method detail#
- LicenseManager.get_license_status(license_name: str) Ansys.Mechanical.DataModel.Enums.LicenseStatus #
Return status of the specific license.
- Parameters:
- license_name
str
Name of the license to check.
- license_name
- Returns:
- “Ansys.Mechanical.DataModel.Enums.LicenseStatus”
The status of the license.
- LicenseManager.set_license_status(license_name: str, status: bool) None #
Set the status of a license and save the preference.
- LicenseManager.enable_session_license(license: str | List[str] | None = None) None #
Enable license(s) for the current session.
- LicenseManager.move_to_index(license_name: str, location: int) None #
Move a license preference.
Move license to zero-based index location in the license preference list. This is useful for setting the preferred license location.
Examples
Move Ansys Mechanical Premium to the first location.
>>> license_manager = LicenseManager(app) >>> license_manager.move_to_index('Ansys Mechanical Premium', 0)