|
Welcome, Guest.
|
||||||
| AutoLISP AutoLISP or Visual LISP, learn both here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: 2000-11
Posts: 21
![]() |
Is there a way to get a computer's name from lsp? I've got the user's name with loginname, but I also need the computer's ID.
|
|
|
|
|
|
#2 |
|
Member
Join Date: 2004-02
Location: Tampa, Florida
Posts: 32
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I know DosLib will do it.
<qoute> dos_computer -------------------------------------------------------------------------------- Returns or sets the computer name of the current system. The name is established at system startup, when it is initialized from the Windows Registry. Changes to the computer name take effect the next time the system is started. </qoute> http://www.mcneel.com/doslib.htm |
|
|
|
|
|
#3 |
|
100 Club
Join Date: 2000-12
Posts: 126
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
If you don't think it's overkill, you can get some info from the Windows WScript object:
Code:
(cond ((setq wscript (vlax-create-object "WScript.Network"))
(setq pcname (vlax-get-property wscript "ComputerName")
pcdom (vlax-get-property wscript "UserDomain")
pcuser (vlax-get-property wscript "UserName")
)
(mapcar 'princ
(list "\nComputername: " pcname
"\nUser domain: " pcdom
"\nUser name: " pcuser
)
)
(vlax-release-object wscript)
)
)
|
|
|
|
|
|
#4 |
|
Member
Join Date: 2000-11
Posts: 21
![]() |
That's exactly what I'm looking for. Thanks Everyone!
|
|
|
|
|
|
#5 |
|
100 Club
Join Date: 2000-12
Posts: 126
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
You're welcome.
For some more on scripting objects, you can check out http://www.afralisp.com/lisp/script1.htm |
|
|
|
|
|
#7 |
|
100 Club
Join Date: 2000-12
Posts: 126
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Mark, you're a genius
why didn't I think of that .. |
|
|
|
|
|
#8 | |
|
Administrator
Join Date: 2001-03
Location: Fenton, MO via the UK
Posts: 13,500
![]() |
Quote:
<PublicMockingMode = On> <PublicMockingMode = Off> I couldn't be so cruel and publicly mock a LISP Jedi Master Cheers, Mike
__________________
|
|
|
|
|
|
|
#9 | |
|
Member
Join Date: 2004-02
Location: Tampa, Florida
Posts: 32
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
|
|
|
|
|
|
|
#10 |
|
Member
Join Date: 2003-12
Location: Portland, Oregon USA
Posts: 13
![]() |
Stig,
I'm glad you posted how to access the wscript host and also the link to AfraLisp. I wasn't aware how easy it is to write code to access objects outside of AutoCAD. Also at AfraLisp, Kenny shows how to use wscript to get the hard disk serial number, which is something I've been looking for. Thanks for posting! |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| License Issue | PeterJ | Revit Architecture - General | 7 | 2005-06-10 12:55 AM |
| Big problems with computer memory while rendering | JGAbbott | Revit - Rendering | 15 | 2004-05-14 12:09 AM |
| What's in the revit package | Nic M. | Revit Architecture - General | 17 | 2003-11-25 09:22 AM |
| New Computer | patagoniadave | Revit - Hardware & Operating Systems | 1 | 2003-07-30 10:43 PM |