Showing results for 
Search instead for 
Do you mean 
Reply

Checking for the availability of a specific license

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

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Checking for the availability of a specific license

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

Re: Checking for the availability of a specific license

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Checking for the availability of a specific license

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

[ Edited ]

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

[ Edited ]

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Checking for the availability of a specific license

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.