Hi everybody,
I've been using AutoCAD since AotuCAD R12, Since then I'm writing autolisp programme for my own use. I've 1 small problem. I don't know the AutoCAD command on how to extract the 9 digit of PCB serial number. The purpose for this is to protect the program it self. I hope somebody can give me the answer. Thank you
Mamy.
Hi..
You can use the HD serial number..
(defun HDSERIAL (drv / DrvObj FSO getDRV) (setq FSO (vlax-create-object "Scripting.FileSystemObject")) (setq getDRV (vlax-invoke FSO 'GetDrive drv)) (vlax-get getDRV 'SerialNumber) (vlax-release-object FSO) (vlax-release-object getDRV) )
Hi Mr. CADO,
Thanks a lot for your reply on my message and helping me to solve the problem.
I've tried the small lisp that posted by you. Unfortunately it's not work. Maybe my AutoCAD version is not competable with the command.
ok I see...
you need to specify your drive.
examples..
(defun HDSERIAL (drv / DrvObj FSO getDRV) (vl-load-com) (setq FSO (vlax-create-object "Scripting.FileSystemObject")) (setq getDRV (vlax-invoke FSO 'GetDrive drv)) (vlax-get getDRV 'SerialNumber) (vlax-release-object FSO) (vlax-release-object getDRV) ) ;| TESTS (HDSERIAL "c:") (HDSERIAL "x:") (HDSERIAL "\\\\Server1\\folderA\\FolderB") |;
put the (vla-load-com) on the top.
Can't find what you're looking for? Ask the community or share your knowledge.