Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-06-08, 09:02 PM   #1
pcs
Member
 
Join Date: 2000-11
Posts: 21
pcs is starting their journey
Default Retrieve Computer ID

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.
pcs is offline   Reply With Quote
Old 2004-06-08, 09:54 PM   #2
MarkTheSwampThomas
Member
 
Join Date: 2004-02
Location: Tampa, Florida
Posts: 32
MarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightly
Default RE: Retrieve Computer ID

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
__________________
C3D/LDT2006
I'd rather be using NetBSD
MarkTheSwampThomas is offline   Reply With Quote
Old 2004-06-08, 11:22 PM   #3
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default

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)
      )
)
stig.madsen is offline   Reply With Quote
Old 2004-06-08, 11:24 PM   #4
pcs
Member
 
Join Date: 2000-11
Posts: 21
pcs is starting their journey
Thumbs up RE: Retrieve Computer ID

That's exactly what I'm looking for. Thanks Everyone!
pcs is offline   Reply With Quote
Old 2004-06-08, 11:47 PM   #5
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default RE: Retrieve Computer ID

You're welcome.

For some more on scripting objects, you can check out http://www.afralisp.com/lisp/script1.htm
stig.madsen is offline   Reply With Quote
Old 2004-06-09, 12:35 PM   #6
MarkTheSwampThomas
Member
 
Join Date: 2004-02
Location: Tampa, Florida
Posts: 32
MarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightly
Default RE: Retrieve Computer ID

What about this:
(princ (getenv "COMPUTERNAME"))
__________________
C3D/LDT2006
I'd rather be using NetBSD
MarkTheSwampThomas is offline   Reply With Quote
Old 2004-06-09, 01:41 PM   #7
stig.madsen
100 Club
 
Join Date: 2000-12
Posts: 126
stig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightlystig.madsen is glowing brightly
Default RE: Retrieve Computer ID

Mark, you're a genius

why didn't I think of that ..
stig.madsen is offline   Reply With Quote
Old 2004-06-09, 01:55 PM   #8
Mike.Perry
Administrator
 
Mike.Perry's Avatar
 
Join Date: 2001-03
Location: Fenton, MO via the UK
Posts: 13,500
Mike.Perry has disabled reputation
Wink RE: Retrieve Computer ID

Quote:
Originally Posted by stig.madsen
why didn't I think of that ..
Hi Stig

<PublicMockingMode = On>
<PublicMockingMode = Off>

I couldn't be so cruel and publicly mock a LISP Jedi Master wouldn't want to experience the wrath further down the road when I require your help.

Cheers, Mike
__________________
..........MeWhee
Mike.Perry is offline   Reply With Quote
Old 2004-06-09, 01:55 PM   #9
MarkTheSwampThomas
Member
 
Join Date: 2004-02
Location: Tampa, Florida
Posts: 32
MarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightlyMarkTheSwampThomas is glowing brightly
Default RE: Retrieve Computer ID

Quote:
Originally Posted by stig.madsen
Mark, you're a genius

why didn't I think of that ..
I'm still trying to figure out why I didn't post that in the first place! *grin*
__________________
C3D/LDT2006
I'd rather be using NetBSD
MarkTheSwampThomas is offline   Reply With Quote
Old 2004-06-10, 05:16 AM   #10
sdoman
Member
 
sdoman's Avatar
 
Join Date: 2003-12
Location: Portland, Oregon USA
Posts: 13
sdoman is starting their journey
Default

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!
sdoman is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

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


All times are GMT +1. The time now is 02:23 PM.