On 01/12/12 15:30, Steve Galayda wrote:
>
> That's great.
>
> Just testing it out and it works. All I did was add to the existing mapkey two lines after the label text portion. I always forget about the OS
> Script tab in mapkeys.
>
> mapkey imaf @MAPKEY_NAMExxxxxxx @MAPKEY_LABELxxx;\
>
> *mapkey(continued) @SYSTEMSET UseLog=K:\Standards\Utilities\pro_log\Usage_Log.txt\nECHO \*
>
> *mapkey(continued) \%USERNAME\%,\%DATE\%,\%TIME\%,imaf >> \%UseLog\%;\*
>
> mapkey(continued) ~ Command `ProCmdMmSetup` ;#MATERIAL;\
>
> I would put the name of the mapkey in the second of the two added lines for each mapkey in the config.pro.
>
> Depending on the amount of mapkeys there could be a lot of work to add the two lines manually.
>
> Is there is a way to set it so, as Mike said, the mapkey does not open another window? The way I did it above opens a command prompt window. I
> don't think a batch file would work if you wanted to record the name of the mapkey. Any ideas?
>
Well if you were running on a unix platform the OS scripts do not open a terminal window so this kind of thing thing is trivial. For example the
following sh script:
----------------------------------------------------------------------------------
#!/bin/sh
#takes 1 argument = name of mapkey to log
#record the date [tab] login name [tab] name of mapkey
#define name of mapkeylog file to record to
#mapkeylog="someFilePathCouldBeNetworked"
mapkeylog="mapkeylog.txt"
echo "`date`\t$LOGNAME\t$1" >> $mapkeylog
----------------------------------------------------------------------------------
If saved to a file called log_mapkey.sh could be called in a mapkey like this:
mapkey xx @SYSTEMlog_mapkey.sh xx;\
do other mapkey stuff\
more mapkey stuff
If I was actually doing something like this for real I would create a jlink app that does the following:
1. Create a new menu selection in Pro/Engineer (ie MapKeyLogger)
2. when MapKeyLogger is selected it asks for a string (session.UIReadStringMessage(null)

3. this string is then stored in a database (in my case I would use mysql) along with the users login name, timestamp, and any other pertinent
information. With jlink in the mix you could also get information such as the release and build code of the user's session of Pro/Engineer.
The purpose of this new menu selection is to be used in mapkeys. To use this functionality the above mapkey xx would be rewritten like this:
mapkey xx ~ Command `MapKeyLogger` ;xx;\
do other mapkey stuff\
more mapkey stuff
This operates "invisible" to the user and is platform independent.
> Steve G
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
> *From:*Uminn, Tom [
>
> 6620 Chase Oaks Blvd
> Plano, TX 75023-2310_
> _www.raytheon.com