TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: baitang36 on August 08, 2021, 07:44:05 AM

Title: found a function: get-logical-drives
Post by: baitang36 on August 08, 2021, 07:44:05 AM
Using this function, you can get all drive letters.
However, this function is a reserved function of AutoCAD and is not written to public documents. It can only be invoked in Fas and can not be used in LSP.
An example is attached
Title: Re: found a function: get-logical-drives
Post by: It's Alive! on August 08, 2021, 08:29:33 AM
should be able to do this via COM and WMI service
see https://docs.microsoft.com/en-us/windows/win32/wmisdk/wmi-tasks--disks-and-file-systems

edit "Scripting.FileSystemObject" Drives collection maybe
Title: Re: found a function: get-logical-drives
Post by: mm_clover on August 08, 2021, 09:21:42 AM
谢谢分享Thank you for sharing!
Title: Re: found a function: get-logical-drives
Post by: Rod on August 08, 2021, 06:16:18 PM
Cool baitang36

If anyone is looking for an uncompiled alternative HighFlyingBird has created sometheing
http://www.theswamp.org/index.php?topic=38102.msg431146#msg431146 (http://www.theswamp.org/index.php?topic=38102.msg431146#msg431146)

Cheers, Rod.
Title: Re: found a function: get-logical-drives
Post by: BIGAL on August 08, 2021, 09:45:30 PM
You can find drives

Code: [Select]
; drive type 1 is a usb 2 hard disk

(defun UsbDriveSerialNumber ( / fso dr)
  (setq fso (vlax-create-object "Scripting.FileSystemObject"))
  (vlax-for d (vlax-get fso 'Drives)
    (if
  (= (Vlax-get  d 'DriveType) 2)
      (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr)
      )
    )
  )
  (vlax-release-object fso)
  (reverse dr)
)
(UsbDriveSerialNumber)
Title: Re: found a function: get-logical-drives
Post by: baitang36 on August 10, 2021, 03:19:29 AM
You can find drives

Code: [Select]
; drive type 1 is a usb 2 hard disk

(defun UsbDriveSerialNumber ( / fso dr)
  (setq fso (vlax-create-object "Scripting.FileSystemObject"))
  (vlax-for d (vlax-get fso 'Drives)
    (if
  (= (Vlax-get  d 'DriveType) 2)
      (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr)
      )
    )
  )
  (vlax-release-object fso)
  (reverse dr)
)
(UsbDriveSerialNumber)
thank you
Title: Re: found a function: get-logical-drives
Post by: d2010 on August 10, 2021, 05:49:39 AM
How to inject userCPU-ID-codes directly to programe_jc_aro10.Lsp.Txt?? (https://forums.autodesk.com/autodesk/attachments/autodesk/130/418520/1/cl_aclayer_entdimen_2020_pp_dcmwa_mtexttoleader-vlxc.zip)

Eu am nevoie de ajutor, sa compilam sursa LISP blochata pe seriaL CPU-id
Daca sursa este compilata pe serial CPU-ID, atunci chair Tu nu poti executa
programe.LSP.txt chiar in calculatorul baitang36Win10.

How to encrypt programe.Lsp.Txt with  only, once CPU-ID-code,before FAs or before.Vlx ?? (https://forums.autodesk.com/autodesk/attachments/autodesk/130/418520/1/cl_aclayer_entdimen_2020_pp_dcmwa_mtexttoleader-vlxc.zip)
Code - Auto/Visual Lisp: [Select]
  1. Please help me, I cannot make only-Alone?>
:whistling:
Code: [Select]
:whistling:
[quote author=baitang36 link=topic=56936.msg605882#msg605882 date=1628579969]
You can find drives
(defun UsbDriveSerialNumber ( / fso dr)
  (setq fso (vlax-create-object "Scripting.FileSystemObject"))
  (vlax-for d (vlax-get fso 'Drives)
    (if
  (= (Vlax-get  d 'DriveType) 2)
      (setq dr (cons (list (vla-get-path d) (vla-get-SerialNumber d)) dr)
      )
    )
  )
  (vlax-release-object fso)
  (reverse dr)
)
(UsbDriveSerialNumber)
[/quote]
Tu nu nevoie de extragerea de informatii Hard (CPU-serial, Usb-Serial)
deoarece tu downgrade programul.Vlx, si in acest mod, cerintele soft
programului VLX creste dificulatatile de functionare a programului.VLX
si apar multe incompatibilitatii software , atunci cand Tu compilezi LSP to VLX,
LSP to DES, LSP to ELC(NanoCad)...