TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: CatDance on September 08, 2021, 02:27:07 AM
Title:
how to check current running lisp is loaded from which drive and folder ?
Post by:
CatDance
on
September 08, 2021, 02:27:07 AM
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.
Title:
Re: how to check current running lisp is loaded from which drive and folder ?
Post by:
baitang36
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")
)
)
Title:
Re: how to check current running lisp is loaded from which drive and folder ?
Post by:
baitang36
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)))
)
Title:
Re: how to check current running lisp is loaded from which drive and folder ?
Post by:
Grrr1337
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]
; (GetLastApploadedLispPath)
(
defun
GetLastApploadedLispPath
(
)
(
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"
)
; strcat
"MainDialog"
)
; vl-registry-read
)
; defun
Code - Auto/Visual Lisp:
[Select]
_$
(
GetLastApploadedLispPath
)
"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]
_$
(
vl
-
registry
-
read
"HKEY_CURRENT_USER
\\
Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
ComDlg32
\\
OpenSavePidlMRU
\\
lsp"
"MRUListEx"
)
>>
(
3
)
and
Code - Auto/Visual Lisp:
[Select]
_$
(
vl
-
registry
-
read
"HKEY_CURRENT_USER
\\
Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
ComDlg32
\\
OpenSaveMRU
\\
lsp"
(
itoa
(
car
(
vl
-
registry
-
read
"HKEY_CURRENT_USER
\\
Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Explorer
\\
ComDlg32
\\
OpenSavePidlMRU
\\
lsp"
"MRUListEx"
)
)
)
)
>>
nil
Doesn't seem to work.