Code required to get Windows user login name

Code required to get Windows user login name

jlane
Advocate Advocate
926 Views
4 Replies
Message 1 of 5

Code required to get Windows user login name

jlane
Advocate
Advocate

What is the iLogic code (or VB.NET code) I could use within a rule to get the Windows user login name?  Similar to AutoLISP's (getvar "LOGINNAME").

 

Thx!

0 Likes
Accepted solutions (3)
927 Views
4 Replies
Replies (4)
Message 2 of 5

ekinsb
Alumni
Alumni
Accepted solution

.Net supports getting the username but it's probably easier to just use Inventor's API.  This will get it:

 

ThisApplication.UserName


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 5

NachoShaw
Advisor
Advisor
Accepted solution
Hi

If you want the windows user login name, you can use

dim sUserName As String
SUserName = Environ("Username")

Cheers

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 4 of 5

jlane
Advocate
Advocate

Thanks Brian, that worked!

0 Likes
Message 5 of 5

jlane
Advocate
Advocate
Accepted solution

Thanks nmjshaw150, that worked too!

0 Likes