Jump to content

Recommended Posts

Posted

Hello.

 

I have forgotten the System Variable that would get the author name.

 

Any help please.

 

Thanks a lot.

 

Michaels

Posted

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)
     )

Posted

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

Posted

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.

j1.JPG

Posted

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.

Posted

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

Posted
did you try

 (getenv "username")

note quotation marks

 

I am really sorry.:sweat:

 

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.

Posted

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 :thumbsup:

Posted

Fantastic . :thumbsup:

 

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...