MMS Posted January 4, 2009 Posted January 4, 2009 I wondering how to read physical address with AutoLISP. Regards, MMS Quote
Lee Mac Posted January 4, 2009 Posted January 4, 2009 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 Quote
Lee Mac Posted January 4, 2009 Posted January 4, 2009 Ethernet adapter / mac address. Ahh, of course, excuse my ignorance 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. Quote
ASMI Posted January 5, 2009 Posted January 5, 2009 For first network adapter: (vl-registry-read "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\0001" "HardwareAddress") Quote
MMS Posted January 5, 2009 Author Posted January 5, 2009 Hey ASMI, the result is nil. Do you have any code ? Thanks MMS Quote
ASMI Posted January 5, 2009 Posted January 5, 2009 What operating system you use? What is connection type: onboard LAN-adapter, separate LAN-adapter or WiFi? Quote
kpblc Posted January 5, 2009 Posted January 5, 2009 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 Quote
MMS Posted January 5, 2009 Author Posted January 5, 2009 What operating system you use? What is connection type: onboard LAN-adapter, separate LAN-adapter or WiFi? I'm use LAN-adapter. Thanks. Quote
ASMI Posted January 6, 2009 Posted January 6, 2009 Hi. Your OS is Vista? There seems missed "HardwareAddress" key in the Registry Try to use kpblc function. Quote
Raggi_Thor Posted January 6, 2009 Posted January 6, 2009 Maybe DosLib will work for you? http://en.wiki.mcneel.com/default.aspx/McNeel/DOSLib.html dos_macaddress Quote
Recommended Posts
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.