Change Revit User Name

Change Revit User Name

Moustafa_K
Advisor Advisor
2,023 Views
5 Replies
Message 1 of 6

Change Revit User Name

Moustafa_K
Advisor
Advisor

Is there an access to change the username of the document via API?

Moustafa Khalil
Cropped-Sharp-Bim-500x125-Autodesk-1
0 Likes
2,024 Views
5 Replies
Replies (5)
Message 2 of 6

Dale.Bartlett
Collaborator
Collaborator

My understnding is that this property is read only.

From SDK help:

BasicFileInfo..::..Username Property 
BasicFileInfo Class 
Returns the username.
Namespace: Autodesk.Revit.DB
C#
public string Username { get; }




______________
Yes, I'm Satoshi.
0 Likes
Message 3 of 6

Dale.Bartlett
Collaborator
Collaborator

Which leads me to my next question:

How to return the Revit Username?

<code>

BasicFileInfo bfi = new BasicFileInfo();

return bfi.Username;

</code>

Is not correct: "no constructors defined"

Thanks, Dale




______________
Yes, I'm Satoshi.
0 Likes
Message 4 of 6

Revitalizer
Advisor
Advisor

UIApplication.Application.Username




Rudolf Honke
Software Developer
Mensch und Maschine





Message 5 of 6

arnostlobel
Alumni
Alumni
Hello Dale,

It looks like the only method to get an instance of BasicFileInfo is static BasicFileInfo.Extract. Please note it does not work with an open document. It takes a path of a file on disk.

I do agree the documentation for the needs BasicFileInfo class to be improved. I have created a task for the responsible development team to update the documentation. Thank you for bringing this problem to our attention.
Arnošt Löbel
Message 6 of 6

harrymattison
Advocate
Advocate

Hi Autodesk,

 

Please enable setting the Application.Username property in a future release.

 

Thanks

Harry