Jump to content

Recommended Posts

Posted

I wondering how to read physical address with AutoLISP.

 

Regards,

 

MMS

Posted
I wondering how to read physical address with AutoLISP.

 

Regards,

 

MMS

 

I wonder if you could clarify further what you mean by physical address?

 

Thanks :)

Posted
Ethernet adapter / mac address.

 

 

Ahh, of course, excuse my ignorance :P

 

On first thoughts - I would doubt it. But you can find out all sorts of things with the LISP, like version, time, date, etc etc - so I wouldn't rule it out completely. :)

Posted

For first network adapter:

 

(vl-registry-read "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\0001" "HardwareAddress")

Posted

Hey ASMI,

 

the result is nil.

 

Do you have any code ?

 

Thanks

 

MMS

Posted

What operating system you use? What is connection type: onboard LAN-adapter, separate LAN-adapter or WiFi?

Posted

http://www.caduser.ru/cgi-bin/f1/board.cgi?t=43327xi&page=1 :

(defun vk_getmacaddress (/             locatorobj    serviceobj
                            securityobj   objectsetobj  outlist
                            )
 (setq locatorobj (vlax-create-object "WbemScripting.SWbemLocator"))
 (setq serviceobj
        (vlax-invoke
          locatorobj 'connectserver nil nil nil nil nil nil nil nil) ;_ end of vlax-invoke
       ) ;_ end of setq
 (setq objectsetobj
        (vlax-invoke
          serviceobj
          'execquery
          "Select * from Win32_NetworkAdapter"
          ) ;_ end of vlax-invoke
       ) ;_ end of setq
 (vlax-for obj objectsetobj
   (if (wcmatch (vl-princ-to-string (vlax-get obj 'adaptertype))
                "Ethernet 802.*"
                ) ;_ end of wcmatch
     (setq outlist (cons (vlax-get obj 'macaddress) outlist))
     ) ;_ end of if
   ) ;_ end of vlax-for
 (foreach obj (list locatorobj serviceobj securityobj objectsetobj)
   (and obj (vlax-release-object obj))
   ) ;_ end of foreach
 outlist
 ) ;_ end of defun

Posted
What operating system you use? What is connection type: onboard LAN-adapter, separate LAN-adapter or WiFi?

 

I'm use LAN-adapter.

 

Thanks.

Posted

Hi. Your OS is Vista? There seems missed "HardwareAddress" key in the Registry :x Try to use kpblc function.

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