Skip to main content
17-Peridot
January 22, 2019
Solved

Get information from license server?

  • January 22, 2019
  • 1 reply
  • 2238 views
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.
Best answer by FV_01

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.

1 reply

FV_0117-PeridotAnswer
January 25, 2019

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.

17-Peridot
January 28, 2019

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?

January 29, 2019

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