LicenseManager Class

class NXOpen.LicenseManager

Bases: object

Provides utility methods for managing licenses.

This class only manages the licenses that are used by the current NX Open application. If several applications are loaded in a session, each application will have its own independent license manager. It is possible for two applications to both reserve the same license. Although this will only reserve a single license from the FLEX server, the license will not be released to the server until both applications have released it.

As of NX6 the concept of User-Defined License Contexts has been introduced. This concept gives greater control of licensing of the application. To find out more about this topic, please reference the NXOpen Programmer’s Guide. All user-defined context names have a max length of 128 characters long consisting of only numbers and letters.

The main NX User Interface will also manage licenses independently. If an NX Open application releases the “solid_modeling” license, but the main NX UI is still using that license, then it will not be returned to the server.

Methods for this class use the license feature name, which can be found in the documentation for NX Open methods and properties. This is in the format <tt>License requirements: license feature name (“license description”)</tt>. For example, given <tt>License requirements: solid_modeling (“SOLIDS MODELING”)</tt>, then the license feature name, <tt>solid_modeling</tt> would be used.

To obtain an instance of this class, refer to NXOpen.Session

New in version NX4.0.0.

Methods

Method Description
GetActiveLicensesInABundle Returns the list of checked out licenses from the given bundle
GetBundlesSelected Returns an array of license bundles in the form of a structure LicenseManagerLicenseBundle_Struct that are currently selected
GetBundlesUsed Returns the list of bundles that have licenses currently checked out
GetReservedLicenses Returns the licenses that are currently reserved against a context.
Release Release a license against the specified license context.
ReleaseAll Release all licenses against the specified license context.
Reserve Reserve a license against the specified license context.
SetBundlesForUse Changes the existing license bundle selection.

Structs

LicenseManagerLicenseBundle_Struct Struct License bundle structure containing name of license bundle and number of licenses checked out of the bundle.

Method Detail

GetActiveLicensesInABundle

LicenseManager.GetActiveLicensesInABundle

Returns the list of checked out licenses from the given bundle

Signature GetActiveLicensesInABundle(bundleName)

Parameters:bundleName (str) –
Returns:
Return type:list of str

New in version NX11.0.0.

License requirements: None.

GetBundlesSelected

LicenseManager.GetBundlesSelected

Returns an array of license bundles in the form of a structure LicenseManagerLicenseBundle_Struct that are currently selected

Signature GetBundlesSelected()

Returns:
Return type:list of NXOpen.LicenseManagerLicenseBundle_Struct

New in version NX11.0.0.

License requirements: None.

GetBundlesUsed

LicenseManager.GetBundlesUsed

Returns the list of bundles that have licenses currently checked out

Signature GetBundlesUsed()

Returns:
Return type:list of str

New in version NX11.0.0.

License requirements: None.

GetReservedLicenses

LicenseManager.GetReservedLicenses

Returns the licenses that are currently reserved against a context.

This method will also output the licenses reserved against the default context in the syslog.

Signature GetReservedLicenses(contextName)

Parameters:contextName (str) – Name of context to release against. Will use the default context if None is specified.
Returns:
Return type:list of str

New in version NX6.0.0.

License requirements: None.

Release

LicenseManager.Release

Release a license against the specified license context.

Signature Release(license, contextName)

Parameters:
  • license (str) – License feature name to be released
  • contextName (str) – Name of context to release license against. Will use the default context if None is specified.

New in version NX6.0.0.

License requirements: None.

ReleaseAll

LicenseManager.ReleaseAll

Release all licenses against the specified license context.

If the context specified is a user-defined context it will be deleted.

Signature ReleaseAll(contextName)

Parameters:contextName (str) – Name of context release to release. Will use the default context if None is specified.

New in version NX6.0.0.

License requirements: None.

Reserve

LicenseManager.Reserve

Reserve a license against the specified license context.

If the specified user-defined context does not already exist it will be created.

Signature Reserve(license, contextName)

Parameters:
  • license (str) – License feature name to be reserved
  • contextName (str) – Name of context to reserve license against. Will use the default context if None is specified.

New in version NX6.0.0.

License requirements: None.

SetBundlesForUse

LicenseManager.SetBundlesForUse

Changes the existing license bundle selection.

If the bundle switch fails because a license that is in use is not available in the new bundles, then an error will be returned and the bundle configuration will not be changed.

Signature SetBundlesForUse(bundles)

Parameters:bundles (list of str) – The bundles are set in the same order as specified

New in version NX11.0.0.

License requirements: None.