Is there a way via the API to check for a valid license. I want to check for this before I attempt to create the NavisworksApplication() object.
If no license is available when trying to create the NavisworksApplication, then a dialog pops up. I would rather this dialog not appear, so before attempting any automation, I want to check for license availability first.
I solved this by querying the Flexlm server and browsing the returned string for the license and available licenses.
E.g. Using the System.Diagnostics.Process with necessary arguments:
lmutil lmstat -a -f [feature] -c [port]@[servername]
Capturing the Process.StandardOutput.ReadToEnd() you can use regular expressions or similar to very fast find the necessary availability of the licenses.
Hope this gave some ideas...
Does anyone else consider this a serious ommision from the automation api? The whole point of it is so that we can perform tasks that don't require user interaction!! Checking for a license seems to be pretty integral in the process.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register