Michaels Posted September 12, 2010 Posted September 12, 2010 Hello. I have forgotten the System Variable that would get the author name. Any help please. Thanks a lot. Michaels Quote
lpseifert Posted September 12, 2010 Posted September 12, 2010 If you're referring to the Author from 'Drawing Properties' (command _dwgprops) I don't think there is a system variable. But this should return the dwgprop 'Author' (setq si (vla-Get-SummaryInfo (vla-Get-ActiveDocument (vlax-Get-Acad-Object))) Auth (vla-get-author si) ) Quote
Michaels Posted September 12, 2010 Author Posted September 12, 2010 Thank you so much. But is doesn't work, and here what I am looking for something like (getvar 'user........ I did use it before and it does gave me the name. Regards. Michaels Quote
lpseifert Posted September 12, 2010 Posted September 12, 2010 yes it does work... it returned "" because you don't have anything entered in the Author area of the Drawing Properties (BTW the variable for the Author would be 'Auth' in the above code, not 'si') Maybe you're looking for the system variable Loginname... (getvar "loginname") or the environment variable Username (getenv "username") neither of the two variables has anything to do with Author though. Quote
Michaels Posted September 12, 2010 Author Posted September 12, 2010 YES. you are completely right. Actually (getvar 'loginname) is the one that I am looking forward. What should I enter to get the author name ? plus the Sys Var (getenv "username") return error as following ? Command: (getenv 'username) ; error: bad argument type: stringp USERNAME Thanking you. Quote
lpseifert Posted September 12, 2010 Posted September 12, 2010 You need to enter the Author in Drawing Properties first- see above image The command for the drawing properties is _DWGPROPS did you try (getenv "username") note quotation marks Quote
Michaels Posted September 12, 2010 Author Posted September 12, 2010 did you try (getenv "username") note quotation marks I am really sorry. I used to make it with Lisp with one quote ( ' ) but like your last post ... (getenv "username") It works great. I am sorry for wasting your time. Michaels. Quote
lpseifert Posted September 12, 2010 Posted September 12, 2010 I used to make it with Lisp with one quote ( ' ) but like your last post ... getenv doesn't work that way if you learned something it wasn't a waste of time Quote
Michaels Posted September 12, 2010 Author Posted September 12, 2010 Fantastic . I use it like the way that I used to handle it with (getvar '.........) . Thanks for reminding and paying my attention to it. Greatly appreciated. Quote
irneb Posted September 13, 2010 Posted September 13, 2010 The reason you can't use the single quote on getenv, is that getenv uses case sensitivity for the registry entry it's fetching. When you use a single quote it actually sends using an All-Caps string, thus it's not found. Getvar works only on the system variables - which are all case-insensitive. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.