Author Topic: Connection Name  (Read 3329 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Connection Name
« 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 ?
Keep smile...

whdjr

  • Guest
Re: Connection Name
« Reply #1 on: February 16, 2006, 11:32:01 AM »
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'.

sinc

  • Guest
Re: Connection Name
« Reply #2 on: February 16, 2006, 12:04:01 PM »
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?

whdjr

  • Guest
Re: Connection Name
« Reply #3 on: February 16, 2006, 01:17:39 PM »
Your French must not be very good either.   :-D

oops   :oops:

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Connection Name
« Reply #4 on: February 16, 2006, 01:30:14 PM »
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 ?

Keep smile...

whdjr

  • Guest
Re: Connection Name
« Reply #5 on: February 16, 2006, 01:46:31 PM »
You can use the Field expression in lisp as long as you are supplying the expression for text input ie: mtext, text, attributes,..

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Connection Name
« Reply #6 on: February 16, 2006, 03:04:40 PM »
thanks...

But if i need to put     %<\AcVar Login \f "%tc4">%
in a variable.. ?

(setq var1 "%<\AcVar Login \f \"%tc4\">%")

!var1 = Andrea Andreetti  ?
Keep smile...

whdjr

  • Guest
Re: Connection Name
« Reply #7 on: February 16, 2006, 04:21:42 PM »
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.

vladimirzm

  • Guest
Re: Connection Name
« Reply #8 on: February 17, 2006, 01:46:35 AM »
Your French must not be very good either.   :-D

oops   :oops:

Don't worry whdjr...

the Spanish version...  :-D :-D :-D

vladimirzm

  • Guest
Re: Connection Name
« Reply #9 on: February 17, 2006, 02:18:39 AM »
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:
Code: [Select]
(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:
Code: [Select]
(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
    )
  )
)

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Connection Name
« Reply #10 on: February 17, 2006, 08:48:08 AM »
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.
 :-(
Keep smile...