Skip to main content
17-Peridot
Jan 22, 2019 5:03 PM UTC
Solved

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.
FV_01
FV_01Answer
Jan 25, 2019 4:12 PM UTC

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

FV_01
FV_0117-PeridotAnswer
Jan 25, 2019 4:12 PM UTC

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.

Translate
17-Peridot
Jan 28, 2019 8:12 AM UTC

Hi, @FV_01 

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?

Translate
FV_01
Jan 29, 2019 5:33 PM UTC

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

Translate