cancel
Showing results for 
Search instead for 
Did you mean: 

Checking for the availability of a specific license

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hello everyone!

 

Is it possible to use NX Open to check whether the specific license (advanced assemblies is my case) is available?

7 REPLIES

Re: Checking for the availability of a specific license

Esteemed Contributor
Esteemed Contributor
theSession.LicenseManager.Reserve("solid_modeling", Nothing)

If this call fails, then there is no solid modeling license available nor a bundle used that includes it.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Checking for the availability of a specific license

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Thanks! Good to know. Does this code actually reserves the license, if successful?

Re: Checking for the availability of a specific license

Esteemed Contributor
Esteemed Contributor

Yes, the namespace also includes a method to explicitly free the license, but usually this is done automatically by NX from what I have seen.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Checking for the availability of a specific license

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

So what I basically do here is reserve the license and if successful, just release it?

Re: Checking for the availability of a specific license

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Also, how do you define "Nothing" in this case? I'm afraid I do not understand the contexts yet.

 

Update: Oops, just realised Nothing is null in VB. Smiley Happy 

Re: Checking for the availability of a specific license

Esteemed Contributor
Esteemed Contributor

From the description of the method it is not clear what a context will be, so specifying nothing will check the license in the default context, which has always worked in my cases.

In addition I don't really release the license, since I do the check to allow the user to enter the modeling application for example, so the license is released automatically after the modeling application has been exited.

I would release the license only when the utility doesn't need it anymore.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: Checking for the availability of a specific license

Genius
Genius

Here is the link to the NXOpen Programmer's Guide documentation, where User-Defined Contexts are explained.

 

https://docs.plm.automation.siemens.com/tdoc/nx/11/nx_api/#uid:xid1162445:index_nxopen_prog_guide:id...

 

Also look at the Remarks section of the LicenseManager Class, in the NXOpen .Net Api Reference, there is also some interesting information there.