Get Autodesk ID or login Email

Get Autodesk ID or login Email

Hubert_Los
Advocate Advocate
1,005 Views
11 Replies
Message 1 of 12

Get Autodesk ID or login Email

Hubert_Los
Advocate
Advocate

Is it possible to get an Autodesk ID from Inventor? 

I tried to use "AddinNETFramework.AdWebServicesWrapper" in an external application, but the .dll file won't load.

 

0 Likes
Accepted solutions (2)
1,006 Views
11 Replies
Replies (11)
Message 2 of 12

J_Pfeifer_
Advocate
Advocate

I used internal usernames passed into a case statement. Most likely there is a better way of getting this information. 

 

 

 

 

Sub SelectNameCase(ByRef ThreeLetters As String)

	Dim username As String = System.Environment.UserName	
	'Dim username As String = "Test"
	'MessageBox.Show(username)
	
	
	Select Case username
		
	Case  "NameA"
		ThreeLetters = "ABC"
	Case  "NameB"
		ThreeLetters = "ABC"
	Case  "NameC"
		ThreeLetters = "ABC"
	Case  "NameD"
		ThreeLetters = "ABC"
	Case "Name E"	
		ThreeLetters = "ABC"
	End Select
	
End Sub 

 

 

 

Not sure what you're attempting to use the usernames for, but this allowed me to set the initials on many of my sketched symbols predicated on who the active user creating them was. 

0 Likes
Message 3 of 12

JelteDeJong
Mentor
Mentor
Accepted solution

try this:

Dim userName = ThisApplication.UserName
Dim userNameLogin = ThisApplication.LoginUserName
Dim userId = ThisApplication.LoginUserId

Jelte de Jong
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.

EESignature


Blog: hjalte.nl - github.com

Message 4 of 12

Hubert_Los
Advocate
Advocate

I would like to grant permissions for specific functions to specific users. Therefore, I want to check what login they have.

@J_Pfeifer_ Unfortunately this won't work in my case.


@JelteDeJong I can only get "ThisApplication.UserName", but there is no data there.


Maybe you know another solution how to give permissions to specific people? Preferably offline

0 Likes
Message 5 of 12

JelteDeJong
Mentor
Mentor
Accepted solution

According to this article these properties are introduced in Inventor 2023. I if you are working with a lower version then I guess you cant use them.

If I remember correct the "Application.UserName" is the name that you will find in your application options. Not very save I expect.

JelteDeJong_0-1722860655506.png

Unforunely for you that the windows login name (like @J_Pfeifer_ suggested) is not working for you because I dont know any other solutions.

 

 

Jelte de Jong
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.

EESignature


Blog: hjalte.nl - github.com

Message 6 of 12

Hubert_Los
Advocate
Advocate

Yes, I can't use an editable element like "ThisApplication.UserName". So I need to add online login. Thank you for your response. I will wait some time for acceptance, maybe someone else will come up with an idea to solve this problem.


0 Likes
Message 7 of 12

AndrewHumiston
Advocate
Advocate

Good Morning.

Could you pass the user login name against a list? there  is a way to access the login name for the application @

 

application.userloginid

 

if your company had the user login id set to the previous part of the email i.e. JDoe@Somecompany.com, and JDoe was set to the Autodesk user login you could do what you are thinking of that way. i hope this idea spurs something for you.

0 Likes
Message 8 of 12

WCrihfield
Mentor
Mentor

The actual one you had in mind (the one we see in the Application Options, on the General tab, is this one:

ThisApplication.GeneralOptions.UserName

The one similar to that you were pointing to sounds like it is just a local copy that property that Inventor makes for itself automatically, for its own uses.  So, as far as I know, they should always have the same value.

Application.LoginUserId 

Application.LoginUserName 

Application.UserName 

GeneralOptions.UserName 

System.Environment.UserName 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 9 of 12

Frederick_Law
Mentor
Mentor

@Hubert_Los wrote:

I would like to grant permissions for specific functions to specific users.


Which functions you want to set permission?

0 Likes
Message 10 of 12

Rich-T
Advocate
Advocate

Perhaps you could block a users access to a given iLogic rule?

0 Likes
Message 11 of 12

Hubert_Los
Advocate
Advocate

@AndrewHumiston 
I can't get "application.userloginid", in version 2023 "ThisApplication.LoginUserId" works, but I need it for a lower version

@WCrihfield 
I checked this and "ThisApplication.GeneralOptions.UserName" is not the same as "ThisApplication.LoginUserId".

@Frederick_Law 
My function in the add-ins that checks some information in the model

@Rich-T 
It is add-ins



The best way to do this is "ThisApplication.LoginUserId", but only as of version 2023. I will use computer information in lower functions, until Inventor is upgraded to a higher version

 

0 Likes
Message 12 of 12

WCrihfield
Mentor
Mentor

That was not the one I was suggesting as being the same, but I guess I was not that specific in my previous post.

I was referring to the following quote from Message 5 above:

"If I remember correct the "Application.UserName" is the name that you will find in your application options. Not very save I expect."

Both the older properties: Application.UserName property and Application.GeneralOptions.UserName property appear to always have the same value.  We have always set the value of Application.GeneralOptions.UserName (the one in the Application Options / General tab) to the value we want to see in the TitleBlocks of all our drawings.  We prefer to use a different formatted UserName in our drawings & CAD files than the UserName of our Windows operating system sign-in credentials.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes