cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Get information from license server?

SOLVED
Level 9

Get information from license server?

Hello!
Is there any way to ubtain informatinon about Creo license server from toolkit application? For exaple a host id from license server from a network.
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Get information from license server?

Hi all,

From toolkit app :

getenv(…) 

environment variables to look at PTC_D_LICENSE_FILE, PROE_START, PRO_DIRECTORY.

then get a path to ptcstatus.bat which is usually in the same directory as $PROE_START command...

then pipe out from 'ptcstatus.bat -nopause' 

_popen ( full_path_to_ptcstatus_with_switch, "rt");

 

process output with fgets(…)

HIH.

FV.

3 REPLIES 3

Re: Get information from license server?

Hi all,

From toolkit app :

getenv(…) 

environment variables to look at PTC_D_LICENSE_FILE, PROE_START, PRO_DIRECTORY.

then get a path to ptcstatus.bat which is usually in the same directory as $PROE_START command...

then pipe out from 'ptcstatus.bat -nopause' 

_popen ( full_path_to_ptcstatus_with_switch, "rt");

 

process output with fgets(…)

HIH.

FV.

Re: Get information from license server?

Hi, @FV 

environment variables to look at PTC_D_LICENSE_FILE, PROE_START, PRO_DIRECTORY.

As I know, by default Creo don't create this variables.

Or I miss something?

Re: Get information from license server?

Hi all,

 

For synchronous types of  Pro/Toolkit  -  getenv(…) will work in the context of the parent process, which is xtop.exe, and that process will have those environment variables automagically initiated. To test this, you could try calling pro/e UI command 'Open System Window' and list environment variables.

For async type apps one has to resort to tricks involving ProToolkitDllLoad() or ProMacro… to force execution in xtop context...

 

HIH.

FV