Actually NX, doesn't really KNOW "which role is active" since technically it doesn't work that way.
Roles are somewhat like a 'macro' which when they are selected they get invoked ('played'), setting the menu/toolbar configuration to match what was captured in the 'role' when it was last saved. After you invoke a 'role' whenever you eventually exit your NX session, the then current menu/toolbar configuration is saved in a file named 'user.mtx' located at...
C:\Documents and Settings\<username>\Local Settings\Application Data\Unigraphics Solutions\<NX version>
...and the next time you log-in and launch that particular version of NX, the system (unless you've set a variable pointing to some other .mtx file) uses the contents of this 'user.mtx' file to set the menu/toolbar configurations for your new session (which BTW, if you were to open it in a text editor it would be virtually identical to the last invoked 'role' if no changes had been made to the menu/toolbar configuration after invoking it). Any changes made using the Customize tools to the menu/toolbars will be saved in this 'user.mtx' file when you next exit your session. That's why changes made in one session are still in effect when you start a new session even if YOU haven't saved any 'roles', and it will remain that way until additional changes are made or some other 'role' is invoked.
So as for what all this means, it would be like opening a Part file and asking NX to tell you what was name of the last 'macro' run on this file yesterday. It doesn't know and neither does NX know which 'role' was last invoked or when. Granted, that information was written in the syslog,
FROM THE SESSION WHERE THE 'ROLE' WAS INVOKED, but even the current syslog will only indicate that it read the information in the 'default' .mtx file, which, unless you have an environment variable pointing to a specific .mtx file, will always be the 'user.mtx' file located at the location which I described above.
So anyway, I hope that clears-up why the system is NOT able to "identify which role is active", because as I first stated, it doesn't work that way.
John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
To an Engineer, the glass is twice as big as it needs to be.