CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 3535 
Plex.Earth connects AutoCAD and Google Earth

CAD tip CAD tip # 11983:

Question CAD 
 %  platform  category 
Q - question

How to use iLogic code to fill username into iProperties?

A - answer The user's login name is available by default in the dialog Application options > General > User name. This name is automatically filled into the iProperty Summary > Author.

If you need to create other custom iProperties or if you want to overwrite the iProperty (field) "Author" with another form of the current user's name, e.g. with a full name and surname from the domain record, use the following iLogic code (inserts the login name into the user iProperty SavedBy, and the full name and surname into the standard property Author):

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

iProperties.Value("Custom", "SavedBy") = ThisApplication.GeneralOptions.UserName
iProperties.Value("Summary","Author") = UserFullName
InventorVb.DocumentUpdate()
Inventor
100% *  CAD 
19.8.2018    1112×  
applies to: Inventor ·

See also:
Tip 12024:How to create a custom iProperty or Parameter with iLogic?
Tip 10852:iLogic - how to get part material and path from a drawing?
Tip 9952:iLogic rule - check whether iProperties are overridden.
Tip 9659:iLogic: adjusting model parameters to match model volume or mass
Tip 9477:Saving a DWG copy of an IDW drawing named by revision number.


Back   All CAD Tips All CAD tips&tricks

How to dimension an ellipse in AutoCAD? « | » Creating table with parcel numbers and areas - AreaTab.

Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Generate hatch patterns automatically from your DWG drawings with
HGEN 2006 More info


Please use these tips at your own risk.
CAD Studio (Xanadu) is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist