ilogic Get User name: property to custom parameter

ilogic Get User name: property to custom parameter

j.romo
Advocate Advocate
5,737 Views
6 Replies
Message 1 of 7

ilogic Get User name: property to custom parameter

j.romo
Advocate
Advocate

Hello im working on a Ilogic code to set the name of the designer (lets calle him "Dave") working on a part that  was made by other user, and the Designer ("Matt") 

The part made By Dave gets  his name from the user name in General Applications\general\User name = "Dave"

but I want this part to be modified by Matt to fill a custom parameter Rev_1 to get the General Applications\general\User name = "Matt" in Matt´s Seat.

So we know Dave made the original part and Matt modified it.

Thanks in advance

 

0 Likes
Accepted solutions (2)
5,738 Views
6 Replies
Replies (6)
Message 2 of 7

JamieVJohnson2
Collaborator
Collaborator

Custom iProperty ('Property' not 'Parameter') should be what you are after.  

    iProperties.Value("Custom", "PlotDate&Time")= Now & " " & Time
    iProperties.Value("Custom", "CurrentUser")=System.Security.Principal.WindowsIdentity.GetCurrent.Name

as an iProperty you can use that on a sheet text object by selecting Custom Properties - Drawing, then the custom property.  This example came from my save stamp code that allows a custom border with text that looks like this:

<FILENAME AND PATH>, <CurrentUser>, <PlotDate&Time>

Now, my current user is not a short name, it is the domain user name, but you can write the code to get any value you wish, (in case of a new drawing, take from an existing iProperty, and store in in the custom iProperty so it won't automatically change later).

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 3 of 7

j.romo
Advocate
Advocate

Jaimie thanks 

that gives me the Computer and name of the User in Windows.

But We want the name of the user name from application options, as shown in the attached image

Some Pcs have Older User names or Generic ones (guys from IT dont like to work much) but each user changes the User Name in application otions directly in inventor. Thats the name I want to get.

Thanks

0 Likes
Message 4 of 7

JamieVJohnson2
Collaborator
Collaborator

perhaps this:   invApp.GeneralOptions.UserName

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 5 of 7

j.romo
Advocate
Advocate
Accepted solution

maybe but how can I use it ?

SyntaxEditor Code Snippet

iProperties.Value("Project", "Engineer") = invApp.GeneralOptions.UserName

this way wont work 

0 Likes
Message 6 of 7

JamieVJohnson2
Collaborator
Collaborator
Accepted solution

sorry, I'm used to .Net, in ilogic, invApp is the inventor.application you can acquire using ThisApplication (I think).

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
Message 7 of 7

j.romo
Advocate
Advocate

Thanks

Worked like this:

SyntaxEditor Code Snippet

oNAME = ThisApplication.GeneralOptions.UserName


iProperties.Value("Project", "Engineer") = oNAME