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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Get information from license server?

YaroslavSin
17-Peridot

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
FV
17-Peridot
17-Peridot
(To:YaroslavSin)

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.

View solution in original post

3 REPLIES 3
FV
17-Peridot
17-Peridot
(To:YaroslavSin)

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.

YaroslavSin
17-Peridot
(To:FV)

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?

FV
17-Peridot
17-Peridot
(To:YaroslavSin)

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

Top Tags