Inventor defaults.xml - Collect machine user name on open .

Inventor defaults.xml - Collect machine user name on open .

luismestre
Advocate Advocate
691 Views
4 Replies
Message 1 of 5

Inventor defaults.xml - Collect machine user name on open .

luismestre
Advocate
Advocate

Hi all

How do I edit the  line code in inventor defaults.xml  file ?

I want Inventor to collect the machine user name and added it in Options>General>user name .

Inventor defaults.xml file is shared within a team of  30 users.

 

Is this possible to do?

 

 

Regards

Luis Mestre

Luis Mestre
Oil&Gas Sr.3D & Subsea/Structural Designer
"Autodesk Autocad/Inventor & 3D Studio Max"
Email:lmsmestre@gmail.com
0 Likes
Accepted solutions (2)
692 Views
4 Replies
Replies (4)
Message 2 of 5

Ktomberlin
Advocate
Advocate
Accepted solution
You can use notepad, but I have been using XML Notepad (http://xmlnotepad.codeplex.com/). Much easier for editing the configuration files, as well as parameter files you need to export, edit and import. Kevin
0 Likes
Message 3 of 5

luismestre
Advocate
Advocate

Hi Kevin

I use notepad as well to edit the files.

My question was about the code line.

Can you help?

 

Regards

Luis Mestre

Luis Mestre
Oil&Gas Sr.3D & Subsea/Structural Designer
"Autodesk Autocad/Inventor & 3D Studio Max"
Email:lmsmestre@gmail.com
0 Likes
Message 4 of 5

Ktomberlin
Advocate
Advocate
Accepted solution

Well this doesn't edit the xml directly, but it does change the user name in options.   This might accomplish what your trying to do. 

 

Code Snippet

WSHnet = CreateObject("WScript.Network")
UserName = WSHnet.UserName
UserDomain = WSHnet.UserDomain
objUser = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
'get user name
UserFullName = objUser.FullName
ThisApplication.GeneralOptions.UserName = UserFullName

 

0 Likes
Message 5 of 5

luismestre
Advocate
Advocate

Hi 

Do I h;ave to run the code as a vb macro?

If so all users will be able to load the macro at start up,  correct?

Luis Mestre
Oil&Gas Sr.3D & Subsea/Structural Designer
"Autodesk Autocad/Inventor & 3D Studio Max"
Email:lmsmestre@gmail.com
0 Likes