TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on February 16, 2006, 11:26:49 AM
-
Hi all..
Is it possible to retreive the connection name vis LISP
like showed in FIELD option ?
-
My spanish (I hope this is Spanish) is not good at all.
What is 'connection name'? Is that like 'loginname'?
Maybe look at environment variables, 'getenv'.
-
My spanish (I hope this is Spanish) is not good at all.
Your French must not be very good either. :-D
But I must admit I can't quite parse the question, either.
Are you trying to access the name of the current plot device from Lisp?
-
Your French must not be very good either. :-D
oops :oops:
-
OK...
Sorry...I have installed the English version of 2006 only to show you this screen... :laugh:
Note:
The "Andrea Andreetti" is my name....and not my LOGINNAME.
also, can i use the Field expression in lisp ?
-
You can use the Field expression in lisp as long as you are supplying the expression for text input ie: mtext, text, attributes,..
-
thanks...
But if i need to put %<\AcVar Login \f "%tc4">%
in a variable.. ?
(setq var1 "%<\AcVar Login \f \"%tc4\">%")
!var1 = Andrea Andreetti ?
-
Andrea,
The reason it doesn't work is because of the " in the expression. The command line is treating it like the end of a string.
-
Your French must not be very good either. :-D
oops :oops:
Don't worry whdjr...
the Spanish version... :-D :-D :-D
-
I forgot to answer :evil:
Andrea, You can get the current user name via Windows Script Host from Vlisp, exactly through the WScript.Network class:
(defun UserName (/ wsn)
(setq wsn (vlax-create-object "WScript.Network"))
(vlax-get-property wsn "UserName")
)
You could get the computer name and user domain too:
(defun PCdats (/ wsn un cn ud)
(setq wsn (vlax-create-object "WScript.Network"))
(setq un (vlax-get-property wsn "UserName")
cn (vlax-get-property wsn "ComputerName")
ud (vlax-get-property wsn "UserDomain")
)
(alert
(strcat "User Name:\t" un
"\nComputer Name:\t"cn
"\nUser Domain:\t" ud
)
)
)
-
Vladi....
thanks, but you code is showing me the LOGINNAME....
don't need that...
I need my real name.
I don'T know where AutoCAD take this.
:-(