Author Topic: how to check current running lisp is loaded from which drive and folder ?  (Read 236 times)

0 Members and 1 Guest are viewing this topic.

CatDance

  • Newt
  • Posts: 34
Example if I loaded a lisp using appload to load it,

when that lisp is running, how to check where it is loaded from ?

Thanks.
you can't find great actors like these anymore these days cos these are legends. Very few of them.
https://www.youtube.com/watch?v=Jd10x8LiuBc

baitang36

  • Newt
  • Posts: 115
Re: how to check current running lisp is loaded from which drive and folder ?
« Reply #1 on: September 08, 2021, 07:34:57 AM »
(defun c:tt ()
  (setq
          nice_path (vl-registry-read
                        (strcat "HKEY_CURRENT_USER\"
                                (vlax-product-key)
                                "\\Profiles\"
                                (vla-get-activeprofile (vla-get-profiles (vla-get-preferences (vlax-get-acad-object))))
                                "\\Dialogs\\Appload"
                        )
                        "MainDialog"
    )
                nice_path (strcat nice_path ";" nice_path "nice\\support")
        )
)

baitang36

  • Newt
  • Posts: 115
Re: how to check current running lisp is loaded from which drive and folder ?
« Reply #2 on: September 08, 2021, 07:43:11 AM »
(defun GetLspPath()
  (setq lsppath
     (vl-registry-read
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\lsp"
(substr
   (vl-registry-read
     "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\lsp"
     "MRUList"
   )
   1
   1
)
     )
  )
  (setenv "ACAD" (strcat (getenv "ACAD") ";" (vl-filename-directory lsppath)))
)

Grrr1337

  • Swamp Rat
  • Posts: 770
Re: how to check current running lisp is loaded from which drive and folder ?
« Reply #3 on: September 14, 2021, 04:01:02 AM »
I've examined baitang36's code and this seems to work for finding the directory's path:

Code - Auto/Visual Lisp: [Select]
  1. ; (GetLastApploadedLispPath)
  2. (defun GetLastApploadedLispPath ( )
  3.   (vl-registry-read
  4.     (strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\Profiles\\"
  5.       "\\Dialogs\\Appload"
  6.     ); strcat
  7.     "MainDialog"
  8.   ); vl-registry-read
  9. ); defun
Code - Auto/Visual Lisp: [Select]
  1. _$ (GetLastApploadedLispPath)
  2. "D:\\CODE STUFF\\LISP\\Potentially USED LISPs\\Curves\\"


But unfortunately I don't have "MRUList" registry, but "MRUListEx" instead, hence:
Code - Auto/Visual Lisp: [Select]
  1. _$ (vl-registry-read
  2.   "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSavePidlMRU\\lsp"
  3.   "MRUListEx"
  4. )
  5. >>
  6. (3)

and
Code - Auto/Visual Lisp: [Select]
  1. _$ (vl-registry-read
  2.     "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSaveMRU\\lsp"
  3.     (itoa
  4.       (car
  5.         (vl-registry-read
  6.           "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ComDlg32\\OpenSavePidlMRU\\lsp"
  7.           "MRUListEx"
  8.         )
  9.       )
  10.     )
  11.   )
  12. >> nil

Doesn't seem to work.
(apply ''((a b c)(a b c))
  '(
    (( f L ) (apply 'strcat (f L)))
    (( L ) (if L (cons (chr (car L)) (f (cdr L)))))
    (72 101 108 108 111 32 87 111 114 108 100)
  )
)